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

DSP using MATLAB示例Example3.6

时间:2016-11-12 09:26:46      阅读:186      评论:0      收藏:0      [点我收藏+]

标签:poi   .com   label   nts   alt   分享   png   log   exp   

技术分享

代码:

n = [-5:5]; x = (-0.9).^n;       % x(n) = 
        
k = -200:200; 
w = (pi/100)*k;              % [0,pi] axis divided into 101 points.
X = x * (exp(-j*pi/100)) .^ (n‘*k);

magX = abs(X); angX = angle(X); realX = real(X); imagX = imag(X);

set(gcf,‘Color‘,‘white‘); 
subplot(2,2,1); plot(w/pi,magX); grid on; axis([-2,2,0,15]); 
title(‘Magnitude Part‘);
xlabel(‘frequency in \pi units‘); ylabel(‘Magnitude  |X|‘); 
subplot(2,2,3); plot(w/pi, angX/pi); grid on; axis([-2,2,-1,1]);
title(‘Angle Part‘);
xlabel(‘frequency in \pi units‘); ylabel(‘Radians/\pi‘);

subplot(‘2,2,2‘); plot(w/pi, realX); grid on;
title(‘Real Part‘);
xlabel(‘frequency in \pi units‘); ylabel(‘Real‘);
subplot(‘2,2,4‘); plot(w/pi, imagX); grid on;
title(‘Imaginary Part‘);
xlabel(‘frequency in \pi units‘); ylabel(‘Imaginary‘);

运行结果:

技术分享  

 

DSP using MATLAB示例Example3.6

标签:poi   .com   label   nts   alt   分享   png   log   exp   

原文地址:http://www.cnblogs.com/ky027wh-sx/p/6056165.html

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