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

    %% Yule-Walker Design of Lowpass Filter
% Design an 8th-order lowpass filter with normalized cutoff frequency 0.6.
% Plot its frequency response and overlay the response of the corresponding
% ideal filter.

% Copyright 2015 The MathWorks, Inc.


%%

f = [0 0.6 0.6 1];
m = [1 1 0 0];
[b,a] = yulewalk(8,f,m);
[h,w] = freqz(b,a,128);

plot(w/pi,abs(h),f,m,'--')
xlabel 'Radian frequency (\omega/\pi)', ylabel Magnitude
legend('Yule-Walker','Ideal'), legend boxoff