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

📄 fg_04_02.m

📁 英文书《Digital Signal Processing with Examples in MATLAB》附带的MATLAB实例
💻 M
字号:
% fg_04_02            Amplitude and phase response.
[ac,bc]=spiird(2,1,2,.2,.25,0,0,20);
a=poly([roots(ac(1,:));roots(ac(2,:))])*ac(1,1)*ac(2,1);
b=poly([roots(bc(1,:));roots(bc(2,:))])*bc(1,1)*bc(2,1);
sp_fig(1);
% Amplitude gain plot.
a=[0.2021    0.3328    0.4517    0.3328    0.2021];
b=[1.0000   -0.2251    0.6568    0.0349    0.0548];
H=fft(a,1000)./fft(b,1000);
h1=subplot(1,2,1);
plot(linspace(0,.5,501),abs(H(1:501)));
%
axis([0,.5,0,1.1]); grid;
set(get(gca,'children'),'color','k')
set(gca,'fontname','times','fontsize',16);
xlabel('\nu (Hz-s)');
ylabel('Amplitude gain = |{\itH}(e^{j\omega})|      ');
% Phase plot.
subplot(1,2,2);
plot(linspace(0,.5,501),unwrap(angle(H(1:501))));
axis([0,.5,-5 2]); grid;
set(get(gca,'children'),'color','k')
set(gca,'fontname','times','fontsize',16);
xlabel('\nu (Hz-s)');
ylabel('Phase = angle ({\itH}(e^{j\omega})) (rad)');

⌨️ 快捷键说明

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