%% Verify Order of FIR Filter
% Design a 20th-order FIR filter with normalized cutoff frequency 0.5\pi rad/sample using the window method. Verify the filter order.

b = fir1(20,0.5);
n = filtord(b)

%
% Design the same filter using designfilt and verify its order.

di = designfilt('lowpassfir','FilterOrder',20,'CutoffFrequency',0.5);
ni = filtord(di)

% Copyright 2015 The MathWorks, Inc.