function [ filtdata ] = lpfilter( data, icutoff)
% lpfilter - low pass filter
% data is a 1D array
% icutoff specifies the cutoff bin 

ftdata = fft(data);
myfilter = zeros(size(data));
myfilter(1:icutoff) = 1;
myfilter(end-icutoff+1:end) = 1;
filtdata = real(ifft(ftdata.*myfilter));


end