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

    %% Lowpass IIR Filter
% Design a lowpass IIR filter with order 8, passband frequency 35 kHz, and
% passband ripple 0.2 dB. Specify a sample rate of 200 kHz. Visualize the
% magnitude response of the filter. Use it to filter a 1000-sample random
% signal.

% Copyright 2015 The MathWorks, Inc.


%%

lpFilt = designfilt('lowpassiir','FilterOrder',8, ...
         'PassbandFrequency',35e3,'PassbandRipple',0.2, ...
         'SampleRate',200e3);
fvtool(lpFilt)
dataIn = randn(1000,1);
dataOut = filter(lpFilt,dataIn);

%%
% Output the filter coefficients, expressed as second-order sections.

sos = lpFilt.Coefficients