码迷,mamicode.com
首页 > 其他好文 > 详细

《DSP using MATLAB》Problem5.23

时间:2018-08-10 10:50:07      阅读:145      评论:0      收藏:0      [点我收藏+]

标签:highlight   printf   ber   div   fprintf   color   grid   int   img   

 

技术分享图片

代码:

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

banner();
%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

% -------------------------------------------------------------------
%               
%                                
% -------------------------------------------------------------------
n = [0:6];
x = [1, 2, -3, 4, -5, 0, 0];
 
N = 7;
x_cir_fold = x(mod(-n, N)+1);

m = -1;

y = cirshftt(x_cir_fold, m, 7);
ny = [0:6];


figure(‘NumberTitle‘, ‘off‘, ‘Name‘, ‘P5.23 x(n) x((-n)) x((-8-n))‘)
set(gcf,‘Color‘,‘white‘); 
subplot(3,1,1); stem(n, x); 
xlabel(‘n‘); ylabel(‘x‘);
title(‘x(n), N=7‘);  grid on;
subplot(3,1,2); stem(n, x_cir_fold);  
xlabel(‘n‘); ylabel(‘‘);
title(‘x((-n)), N=7‘);  grid on;
subplot(3,1,3); stem(ny, y); 
xlabel(‘n‘); ylabel(‘y‘);
title(‘x((-8-n)), N=7‘);  grid on;

  运行结果:

技术分享图片

技术分享图片

 

《DSP using MATLAB》Problem5.23

标签:highlight   printf   ber   div   fprintf   color   grid   int   img   

原文地址:https://www.cnblogs.com/ky027wh-sx/p/9452752.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!