zoukankan      html  css  js  c++  java
  • 离散傅里叶变换(DTFT) MATLAB实例

    image

    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');

    image

    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');

    image

    %求出某一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

    image

    %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')

  • 相关阅读:
    Eclipse中常用的快捷键总结!不收藏后悔!
    MySQL基本命令整理,java数据库秘籍!
    centos 禁用ip v6
    win7 & win10 安装AD管理工具
    CentOS LVM 卷在线扩容
    Windows 与 Linux 、esxi下面查看内存容量和数量
    ESX/ESXi 主机上的每个插槽中安装了多少内存
    使用 esxcli storage vmfs unmap 命令在精简置备的 LUN 上回收 VMFS 删除的块
    vSphere 高级特性FT配置与管理
    vSphere HA 原理与配置
  • 原文地址:https://www.cnblogs.com/sleepy/p/2088431.html
Copyright © 2011-2022 走看看