www.gusucode.com > signal 案例源码程序 matlab代码 > signal/FIRAndIIRDigitalFiltersExample.m

    %% FIR and IIR Digital Filters
% Use |designfilt|  to design FIR and IIR versions of a highpass filter.
% Specify a normalized stopband frequency of 0.3 and a normalized passband
% frequency of 0.6. Verify that each filter is of the correct class.
% Display the frequency responses of the filters.

% Copyright 2015 The MathWorks, Inc.


%%

fir = designfilt('highpassfir','StopbandFrequency',0.3,'PassbandFrequency',0.6);
iir = designfilt('highpassiir','StopbandFrequency',0.3,'PassbandFrequency',0.6);
isfirFIR = isfir(fir)
isiirFIR = isfir(iir)
fvt = fvtool(fir,iir);
legend(fvt,'FIR','IIR')