%% Impulse Response of Highpass FIR Filter
% Design an FIR highpass filter of order 18 using a Kaiser window with \beta=4. Specify a sample rate of 100 Hz and a cutoff frequency of 30 Hz. Display the impulse response of the filter.

b = fir1(18,30/(100/2),'high',kaiser(19,4));
impz(b,1,[],100)

%
% Design the same filter using designfilt and plot its impulse response.

d = designfilt('highpassfir','FilterOrder',18,'SampleRate',100, ...
               'CutoffFrequency',30,'Window',{'kaiser',4});
impz(d,[],100)

% Copyright 2015 The MathWorks, Inc.