| 
经验532 分贝0 家园分1132 在线时间:228 小时最后登录:2024-7-31帖子:156精华:0注册时间:2010-9-5UID:570538
 
 注册:2010-9-5 | 
| 从今天起开始学习MATLAB了 
 
 指数序列x=0.8^n*u(n)的离散时间傅立叶变换(1)
 w=[0:500]*pi/500;            %  [0,pi]轴等分成501个点
 >> X=exp(j*w)./(exp(j*w)-0.2*ones(1,501));
 >> magX=abs(X);            angX=angle(X);           %    计算X 的幅度和相位
 >> realX=real(X);  imagX=imag(X);                     %   计算X 的实部和虚部
 >> subplot(2,2,1); plot(w/pi,magX);  grid
 >> xlabel('frequency in pi units'); ylabel('Magnitude'); title('Manitude Part')
 >> subplot(2,2,3);plot(w/pi,angX); grid;
 >> xlabel('frequncy in pi units'); ylabel('Radians'); title('Angle Part')
 >> subplot(2,2,2);plot(w/pi,realX);grid
 >> xlabel('frequency in pi units'); ylabel('Real Part'); title('Real Part')
 >> subplot(2,2,4);plot(w/pi,imagX);grid
 >> xlabel('frequency in pi units');ylabel('Imaginary'); title('Imaginary Part')
 
 
 
 [ 本帖最后由 timthorpe 于 2011-4-22 02:18 编辑 ]
 | 
 |