首页 > 其他 > 详细

DSP using MATLAB 示例Example2.12

时间:2016-11-05 07:37:42      阅读:256      评论:0      收藏:0      [点我收藏+]

技术分享

代码:

b = [1]; a = [1, -0.9]; n = [-5:50];
h = impz(b,a,n);

set(gcf,‘Color‘,‘white‘); 
%subplot(2,1,1); 
stem(n,h); title(‘Impulse Response‘);
xlabel(‘n‘); ylabel(‘h(n)‘); grid on;

x = stepseq(0, -5, 50) - stepseq(10, -5, 50)
y = filter(b, a, x);
figure; set(gcf,‘Color‘,‘white‘);
%subplot(2, 1,2); 
stem(n,x); title(‘Step Sequence‘);
xlabel(‘n‘); ylabel(‘x(n)‘); grid on;

figure; set(gcf,‘Color‘,‘white‘);
%subplot(2, 1,2); 
stem(n,y); title(‘Output Sequence‘);
xlabel(‘n‘); ylabel(‘y(n)‘); axis([-5,50,-0.5,8]);
grid on;

结果:

技术分享  

技术分享

技术分享

 

DSP using MATLAB 示例Example2.12

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

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