首页 > 其他 > 详细

《DSP using MATLAB》示例Example7.4

时间:2017-03-26 01:31:12      阅读:205      评论:0      收藏:0      [点我收藏+]

技术分享

代码:

h = [-4, 1, -1, -2, 5, 6, 5, -2, -1, 1, -4];
M = length(h); n = 0:M-1;
[Hr, w, a, L] = Hr_Type1(h);
a
L

amax = max(a) + 1; amin = min(a) - 1;

figure(‘NumberTitle‘, ‘off‘, ‘Name‘, ‘Exameple 7.4‘)
set(gcf,‘Color‘,‘white‘); 

subplot(2,2,1); stem(n, h); axis([-1, 2*L+1, amin, amax]);
xlabel(‘n‘); ylabel(‘h(n)‘); title(‘Impulse Response‘); grid on;

subplot(2,2,3); stem(0:L, a); axis([-1, 2*L+1, amin, amax]);
xlabel(‘n‘); ylabel(‘a(n)‘); title(‘a(n) coefficients‘); grid on;

subplot(2,2,2); plot(w/pi, Hr); grid on;
xlabel(‘frequency in \pi units‘); ylabel(‘Hr‘); title(‘Type-1 Amplitude Response‘);

subplot(2,2,4); zplane(h); grid on;
xlabel(‘real axis‘); ylabel(‘imaginary axis‘); title(‘Pole-Zero Plot‘);

  运行结果:

技术分享

技术分享

    从上述图中看出,在ω=0,或者ω=π,振幅谱Hr(ω)没有任何限制。

《DSP using MATLAB》示例Example7.4

原文:http://www.cnblogs.com/ky027wh-sx/p/6618977.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!