• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

离散傅里叶变换(DTFT) MATLAB实例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

w = [0:1:500]*pi/500;
X= exp(1i*w) ./ (exp(1i*w) - 0.5*ones(1,501));        %ones : Create array of all ones
magX= abs(X);
angX = angle(X);
realX = real(X);
imagX = imag(X);
subplot(2,2,1); plot(w/pi, magX);grid
xlabel(\'frequency in pi unit\' );
title (\'magnitude part\');      
ylabel(\'magnitude\');       
subplot(2,2,2);plot(w/pi,angX);grid                     %subplot 为图表定位 2X2图表中第2张
xlabel(\'frequevcy in pi unit\');                                 %X轴坐标
title(\'angle part\');
ylabel(\'radians\');
subplot(2,2,3);plot(w/pi, realX );grid                      %grid为图标加网格线
xlabel(\'frequency in pi unit\' );
title(\'real part\');
ylabel(\'real\');
subplot(2,2,4);plot(w/pi, imagX);grid
xlabel(\'frequency in pi unit\');
title(\'imag part\');
ylabel(\'imag\');

n = -1:3;
x = 1:5;
w= (0:1:500)*pi/500;                             
X= x* exp(-j).^(n\'*w);                                          %n\'  :矩阵n的转制
realX = real(X);
imagX = imag(X);
angX = angle(X);
magX = abs(X);
subplot(2,2,1);plot(w/pi,magX);grid
xlabel(\'fequency in pi unit\');
title(\'magnitude part\');
subplot(2,2,2);plot(w/pi,realX);grid
xlabel(\'frequency in pi unit\');
title(\'real part\');
subplot(2,2,3);plot(w/pi,imagX);grid
xlabel(\'frequency in pi unit\');
title( \'imaginary part\');
subplot(2,2,4);plot(w/pi, angX);grid
xlabel(\'frequency in pi unit\');
title(\'angle part\');

%求出某一f上   所有时间上所有值
n= 0:10;%确定n的范围
w= (-200:1:200)*pi/100;%确定要观察的频率范围
x = (0.9*exp(1i*pi/3)).^n;%确定时间轴上的函数值
X = x*(exp(-1i)).^(n\'*w);%转换到频率轴上
magX = abs(X);
angX = angle(X);
subplot(2,1,1);
plot(w/pi,magX);grid
subplot(2,1,2);
plot(w/pi, angX);grid

%axis 轴        axis()     axis([xmin xmax ymin ymax])
%当输入函数为实数时     观察幅值(偶)与相位(奇)的对称性
n = -10:10 ;
w = (-200:1:200)*pi/100;
x = (-0.9).^n;
X = x * (exp(-1i).^(n\'*w));
magX = abs(X);
angX = angle(X);
subplot(2,1,1);
plot(w/pi,magX);grid
axis([-2,2,0,30]);
title(\'magnitude part\');
subplot(2,1,2);
plot(w/pi, angX);grid
title(\'angle part\')


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Delphi-操作EXCEL发布时间:2022-07-18
下一篇:
Visual Studio 与 Delphi 对话,欢迎讨论。发布时间:2022-07-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap