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

📄 example7_7.m

📁 西交大刘树棠写的《数字信号处理》那本书的所有源代码
💻 M
字号:
wp=0.2*pi;ws=0.3*pi;
tr_width=ws-wp;
M=ceil(6.6*pi/tr_width)

n=[0:1:M-1];
wc=(ws+wp)/2;
hd=ideal_lp(wc,M);
w_ham=(hamming(M))';
h=hd.*w_ham;
[db,mag,pha,grd,w]=freqz_m(h,[1]);
delta_w=2*pi/1000;
Rp=-(min(db(1:1:wp/delta_w+1)))
As=-round(max(db(ws/delta_w+1:1:501)))
subplot(1,1,1)
subplot(2,2,1);stem(n,hd);title('Ideal Impulse Response')
axis([0 M-1 -0.1 0.3]);xlabel('n');ylabel('hd(n)')
subplot(2,2,2);stem(n,w_ham);title('Hamming window')
axis([0 M-1 0 1.1]);xlabel('n');ylabel('w(n)');
subplot(2,2,3);stem(n,h);title('Actural Impulse Response')
axis([0 M-1 -0.1 0.3]);xlabel('n');ylabel('h(n)')
subplot(2,2,4);plot(w/pi,db);title('Magntitude Response in dB');grid
axis([0 1 -100 10]);xlabel('frequency in pi uinits');ylabel('Decibles')

⌨️ 快捷键说明

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