1.)you can use the designfilt function and specify the input
parameters for example), 'StopbandFrequency', 0.35,
'PassbandRipple', 0.25, StopbandAttenuation', 50,
'DesignMethod',\"kaiserwin\")
And you can use the fvtool to visualise the filter response.
lpFilt = designfilt('lowpassfir','PassbandFrequency',0.2,
...
'StopbandFrequency',0.35,'PassbandRipple',0.25, ...
'StopbandAttenuation',50,'DesignMethod','kaiserwin');
fvtool(lpFilt)
type =low pass filter--lowpassfir
% StopbandAttenuation-- =50dB
%window type =kaiser
% pass band frequency =0.2*pi
% stop band frequency =0.35*pi
%pass band ripple =0.25db
2.) another way is we can start by specifying the number of
filter taps N = 31
specify the cut off frequency Â
specify the sampling rate
specify the number of poles or transfer function
determine the filter order
use the fir2 function to define the filter
use the freqz to find the filter coefficients