zoukankan      html  css  js  c++  java
  • 《DSP using MATLAB》示例Example5.9

    代码:

    n = 0:10; x = 10*(0.8) .^ n; y = x(mod_1(-n,11)+1);
    
    %% -----------------------------------------------------------------
    %%                  START   a
    %% -----------------------------------------------------------------
    figure('NumberTitle', 'off', 'Name', 'Exameple5.9a x sequence')
    set(gcf,'Color','white'); 
    subplot(2,1,1); stem(n,x); title('Original sequence x(n)'); %axis([0,10,-2.5,2.5]);
    xlabel('n'); ylabel('x(n)'); grid on;
    subplot(2,1,2); stem(n,y); title('Circularly folded sequence y(n)'); %axis([0,10,-2.5,2.5]);
    xlabel('n'); ylabel('y(n)=x(-n mod 10)'); grid on;
    %% -----------------------------------------------------------------
    %%                  END   a
    %% -----------------------------------------------------------------
    
    
    %% -----------------------------------------------------------------
    %%              START   b
    %% -----------------------------------------------------------------
    X_DFT = dft(x,11);   Y_DFT = dft(y,11);                 % DFT of x and y
    
    realX_DFT = real(X_DFT); imagX_DFT = imag(X_DFT);
    realY_DFT = real(Y_DFT); imagY_DFT = imag(Y_DFT);
    
    figure('NumberTitle', 'off', 'Name', 'Exameple5.9b x sequence')
    set(gcf,'Color','white'); 
    subplot(2,2,1); stem(n,realX_DFT); title('Real {DFT[x(n)]}'); %axis([0,N,-0.5,1.5]);
    xlabel('k'); grid on;
    subplot(2,2,2); stem(n,imagX_DFT); title('Imag {DFT[x(n)]}'); %axis([0,N,-0.5,1.5]);
    xlabel('k'); grid on;
    subplot(2,2,3); stem(n,realY_DFT); title('Real {DFT[x((-n))11]}'); %axis([0,N,-0.5,1.5]);
    xlabel('k'); grid on;
    subplot(2,2,4); stem(n,imagY_DFT); title('Imag {DFT[x((-n))11]}'); %axis([0,N,-0.5,1.5]);
    xlabel('k'); grid on;
    %% -----------------------------------------------------------------
    %%                    END   b
    %% -----------------------------------------------------------------
    

      运行结果:

    牢记: 1、如果你决定做某事,那就动手去做;不要受任何人、任何事的干扰。2、这个世界并不完美,但依然值得我们去为之奋斗。
  • 相关阅读:
    功能测试用例大全
    相对最完整的软件测试工具手册
    测试用例的评审
    黑盒测试学习笔记-(深圳文鹏)
    Llinux:ubuntu常用命令(深圳文鹏)
    HDU-4857(拓扑排序)
    HDU-3665(单源最短路)
    HDU-3661(贪心)
    HDU-2059龟兔赛跑(基础方程DP-遍历之前的所有状态)
    HDU-1047(DP-二进制状态压缩)
  • 原文地址:https://www.cnblogs.com/ky027wh-sx/p/6139808.html
Copyright © 2011-2022 走看看