%% Frequency Response of an FIR filter
% Design an FIR lowpass filter of order 80 using a Kaiser window with \beta=8. Specify a normalized cutoff frequency of 0.5\pi rad/sample. Display the magnitude and phase responses of the filter.

b = fir1(80,0.5,kaiser(81,8));
freqz(b,1)

%
% Design the same filter using designfilt. Display its magnitude and phase responses using fvtool.

d = designfilt('lowpassfir','FilterOrder',80, ...
               'CutoffFrequency',0.5,'Window',{'kaiser',8});
freqz(d)

% Copyright 2015 The MathWorks, Inc.