首页 > 其他 > 详细

《DSP using MATLAB》Problem 2.17

时间:2017-12-09 14:44:00      阅读:221      评论:0      收藏:0      [点我收藏+]

技术分享图片

 

1、代码:

%% ------------------------------------------------------------------------
%%            Output Info about this m-file
fprintf(‘\n***********************************************************\n‘);
fprintf(‘        <DSP using MATLAB> Problem 2.17 \n\n‘);

banner();
%% ------------------------------------------------------------------------


nx1 = [0:4]; x1 = [1, 2, 3, 4, 5];  
nh1 = [0:3]; h1 = [6, 7, 8, 9];

[y1, ny1] = conv_m(x1, nx1, h1, nh1);

ny1
y1

figure(‘NumberTitle‘, ‘off‘, ‘Name‘, ‘Problem 2.17‘)
set(gcf,‘Color‘,[1,1,1])                  % 改变坐标外围背景颜色

subplot(3,1,1); stem(nx1, x1); title(‘x1 sequence‘);
xlabel(‘n‘); ylabel(‘x(n)‘) ;
grid on
subplot(3,1,2); stem(nh1, h1); title(‘h1 sequence‘);
xlabel(‘n‘); ylabel(‘h1(n)‘);
grid on;
subplot(3,1,3); stem(ny1, y1); title(‘y1=x1*h1 sequence‘);
xlabel(‘n‘); ylabel(‘y1(n)‘);
grid on;

  运行结果:

技术分享图片

技术分享图片

 

《DSP using MATLAB》Problem 2.17

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

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