⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fig7-38.m

📁 数字信号处理(机械工业出版社)的源码
💻 M
字号:
%fig7-38
f = [0 .4 .4 .6 .6  1];
H = [0  0  1  1  0  0];
fs = 1000;                      % assumed sampling rate
N = 8;                      	% Order of the filter (number of poles and zeros).
[Bh,Ah] = yulewalk(N,f,H);  	% Working, please wait.....
n = 256;
hh = freqz(Bh,Ah,n);        	% compute complex frequency response
hy  = abs(hh);             	    % compute magnitude
ff  = fs/(2*n) * (0:n-1);
N = 4; passband = [.4 .6]; ripple = .1;
[Bb,Ab] = butter(N, passband);
[Bc,Ac] = cheby1(N, ripple, passband);
h = [abs(hh) abs(freqz(Bb,Ab,n)) abs(freqz(Bc,Ac,n))];
plot(ff(2:n),20*log10(h(2:n,:)))
legend({'YuleWalk','Butterworth','Chebyshev'});
title('YuleWalk, Butterworth and Chebyshev filters')
xlabel('Frequency (Hz)')
ylabel('Magnitude in dB')

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -