Let us suppose that we have signal
>> fs=100;
>> ts=1/fs;
>> t=0:ts:2.93;
>> x=23*sin(2*pi*30*t)+22*cos(2*pi*51*t)+24*sin(2*pi*15*t)+6*randn(size(t));
Because one frequency is high then sampling frequency divided by two, I want to apply low pass filter to that all frequency that are below 50 should stay unchanged, but all others should be removed, so I have tried:
>> fc=50;
>> wn=(2/fs)*fc;
>> b=fir1(20,wn,'low',kaiser(21,3));
but this command
fvtool(b,1,'fs',fs)
the generates error:
Coefficients must be finite.
Also the command
y = filter(b,1,x); removes all frequency components from signal,what is problem?