This paper introduces an algorithm of a frequency flexible Gabor filter based on stochastic computation. The stochastic Gabor filter provides area-efficient hardware implementation compared to a traditional implementation, but a spacial frequency of the stochastic Gabor filter is restricted by the number of states in an up-down counter used in hardware. In the proposed algorithm, a frequency is determined by two parameters: the number of states and a scaling factor to an input signal. As the input-signal range is scaled down from a stochastic-signal range of [-1at1], a tentative frequency determined by the number of states is precisely controlled to synthesize a flexible frequency desired. The proposed stochastic Gabor filter is modelled and simulated in MATLAB that demonstrates a flexible frequency is synthesized, unlike the conventional method.