I am designing a digital FIR filter using Matlab to the specification of a 5KHz cut off frequency, however, no matter what order number(N), sampling frequency(fs) or window I use, I cannot get the cut off frequency(fc) below -6dB (to -3dB)?
Is this a quirk with MatLab or am I doing something wrong?
If I use an odd order number: 5KHz is around -15dB If I use an even order number: 5KHz is around -6dB
I have attached a screenshot of my frequency response at the moment. The code used to produce it is below:
%filter parameters
fc = 5000; %5KHz cut off freq
fs = 20000; N = 18; h = fir1((N-1), (fc/fs)*2, 'low',bartlett(N), 'noscale'); fvtool(h, 'Fs', fs)
Best Answer