首页 > 代码库 > DSP using MATLAB示例Example3.6
DSP using MATLAB示例Example3.6
代码:
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
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。