% Sampling frequency
sampleFreq = 20000;
% Filtering frequencies
minFreq = 100;
maxFreq = 105;

% let's make some fake data
datasize = 50000;
data = [1:datasize] * 0;
nFreq = 20;
% make sure there is a signal in the desired range
freq(1) = ( minFreq + maxFreq )/2;
for(i = 2:nFreq)   
    freq(i) = rand * 10000;
    data = data + sin(freq(i)*[1:datasize]/sampleFreq + rand*2*pi)/nFreq;
end

% take the FFT
fftData = fft(data);

% calculate the FFT frequencies
fftFreq = [0:datasize-1]/datasize*sampleFreq;

% zero out the undesired frequencies
fftData(find(fftFreq < minFreq | fftFreq > maxFreq)) = 0;

% recreate the data
filtData = real(ifft(fftData));

