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

📄 iir_2type_sub.m

📁 很多matlab的源代码
💻 M
字号:
switch get (wq1 ,'Value')
case 1
subplot(1,1,1);
Wp = 0.2*pi;
Ws = 0.3*pi;
Rp = 7;
As = 16;
[b,a] = afd_butt(Wp,Ws,Rp,As);
[C,B,A] = sdir2cas(b,a)
[db,mag,pha,w] = freqs_m(b,a,0.5*pi);
subplot(3,2,3);
plot(w/pi,mag);grid
xlabel('w');
ylabel('|H|');
title('幅度响应');
axis([0 0.5 0 1.2]);
subplot(3,2,4);
plot(w/pi,db);grid
xlabel('w');
ylabel('dB');
title('幅度的dB');
axis([0 0.5 min(db) max(db)+2])
subplot(3,2,5);
plot(w/pi,pha);grid
xlabel('w');
ylabel('rad');
title('相位响应');
axis([0 0.5 min(pha) max(pha)])
[ha,x,t] = impulse(b,a);
subplot(3,2,6);
plot(t,ha);grid
xlabel('t');
ylabel('h(t)');
title('脉冲响应');
axis([0 30 min(ha) max(ha)])
case 2
subplot(1,1,1);
Wp = 0.2*pi;
Ws = 0.3*pi;
Rp = 1;
As = 16;
Ripple = 10^(-Rp/20);
Attn = 10^(-As/20);
[b,a] = afd_chb1(Wp,Ws,Rp,As);
[C,B,A] = sdir2cas(b,a)
[db,mag,pha,w] = freqs_m(b,a,0.5*pi);
subplot(3,2,3);
plot(w/pi,mag);grid
xlabel('w');
ylabel('|H|');
title('幅度响应');
axis([0 0.5 0 1.2]);
subplot(3,2,4);
plot(w/pi,db);grid
xlabel('w');
ylabel('dB');
title('幅度的dB');
axis([0 0.5 min(db) max(db)+2])
subplot(3,2,5);
plot(w/pi,pha);grid
xlabel('w');
ylabel('rad');
title('相位响应');
axis([0 0.5 min(pha) max(pha)])
[ha,x,t] = impulse(b,a);
subplot(3,2,6);
plot(t,ha);grid
xlabel('t');
ylabel('h(t)');
title('脉冲响应');
axis([0 30 min(ha) max(ha)])
end

⌨️ 快捷键说明

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