www.gusucode.com > dsp 案例源码程序 matlab代码 > dsp/ImpulseResponseLengthofFilterSystemobjectExample.m

    %% Impulse Response Length of Filter System object  
% This example requires DSP System Toolbox(TM) software.   

%% 
% Design a 4th-order lowpass elliptic filter with a cutoff frequency of
% 0.4*pi rad/sample. Specify 1 dB of passband ripple and 60
% dB of stopband attenuation. Design the filter in pole-zero-gain form and
% obtain the second order section matrix using |zp2sos|. Create a biquad
% filter System object(TM) and input the System object to |impzlength|. 
[z,p,k] = ellip(4,1,60,.4);
[sos,g] = zp2sos(z,p,k);
hBqdFilt = dsp.BiquadFilter('Structure','Direct form I',...
                                            'SOSMatrix', sos,...
                                            'ScaleValues',g);
len = impzlength(hBqdFilt)