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

    %% Filter System Object Design
% This example requires the DSP System Toolbox product.
% 
% Design a 100th-order equiripple lowpass FIR filter System object to be 
% used on a signal sampled at 96 kHz. Specify a passband that extends up to 20 
% kHz and has a ripple of 0.01 dB. Set the stopband attenuation to 80 dB.

% Copyright 2015 The MathWorks, Inc.


N = 100;
Fs = 96e3;
Fpass = 20e3;
Apass = 0.01;
Astop = 80;

filtSpecs = fdesign.lowpass('N,Fp,Ap,Ast',N,Fpass,Apass,Astop,Fs);
lpfir = design(filtSpecs,'equiripple','SystemObject',true);
%% 
% Visualize the resulting design with FVTool.

fvtool(lpfir,'Fs',Fs);