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

    %% Filter Input into Lowpass and Highpass Subbands
% Create a halfband decimator for data sampled at 44.1 kHz. Use a 
% minimum-order design with a transition width of 2 kHz and a stopband
% attenuation of 60 dB.

% Copyright 2015 The MathWorks, Inc.


hfirhalfbanddecim = dsp.FIRHalfbandDecimator(...
    'Specification','Transition width and stopband attenuation',...
    'TransitionWidth',2000,'StopbandAttenuation',60,'SampleRate',44.1e3);
%%
% Filter a two-channel input into low and highpass subbands
x = randn(1024,2);
[ylow,yhigh] = step(hfirhalfbanddecim,x);