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

    代码:

    %% ----------------------------------------------------------
    %%             START   N=5
    %% ----------------------------------------------------------
    N = 5; k = 0:1:N-1;                             % sample index
    wk = 2*pi*k/N; zk = exp(j*wk);                  % samples of z
    Xk = (zk)./(zk-0.7);                            % DFS as samples of X(z)
    xn = real(idfs(Xk,N));                          % IDFS
    xtilde = xn'*ones(1,8); xtilde = (xtilde(:))';  % Periodic sequence
    
    figure('NumberTitle', 'off', 'Name', 'Example5.5')
    set(gcf,'Color','white'); 
    subplot(2,2,1); stem(0:39, xtilde); axis([0, 40, -0.1, 1.5]);
    xlabel('n'); ylabel('xtilde(n)'); grid on;
    title('N=5');
    %% -----------------------------------------------------------
    %%             END    N=5
    %% -----------------------------------------------------------
    
    
    %% ----------------------------------------------------------
    %%             START   N=10
    %% ----------------------------------------------------------
    N = 10; k = 0:1:N-1;                            % sample index
    wk = 2*pi*k/N; zk = exp(j*wk);                  % samples of z
    Xk = (zk)./(zk-0.7);                            % DFS as samples of X(z)
    xn = real(idfs(Xk,N));                          % IDFS
    xtilde = xn'*ones(1,4); xtilde = (xtilde(:))';  % Periodic sequence
    
    subplot(2,2,2); stem(0:39, xtilde); axis([0, 40, -0.1, 1.5]);
    xlabel('n'); ylabel('xtilde(n)'); grid on;
    title('N=10');
    %% ----------------------------------------------------------
    %%             END   N=10
    %% ----------------------------------------------------------
    
    
    %% ----------------------------------------------------------
    %%             START   N=20
    %% ----------------------------------------------------------
    N = 20; k = 0:1:N-1;                            % sample index
    wk = 2*pi*k/N; zk = exp(j*wk);                  % samples of z
    Xk = (zk)./(zk-0.7);                            % DFS as samples of X(z)
    xn = real(idfs(Xk,N));                          % IDFS
    xtilde = xn'*ones(1,2); xtilde = (xtilde(:))';  % Periodic sequence
    
    subplot(2,2,3); stem(0:39, xtilde); axis([0, 40, -0.1, 1.5]);
    xlabel('n'); ylabel('xtilde(n)'); grid on;
    title('N=20');
    %% ----------------------------------------------------------
    %%             END   N=20
    %% ----------------------------------------------------------
    
    
    %% ----------------------------------------------------------
    %%             START   N=40
    %% ----------------------------------------------------------
    N = 40; k = 0:1:N-1;                            % sample index
    wk = 2*pi*k/N; zk = exp(j*wk);                  % samples of z
    Xk = (zk)./(zk-0.7);                            % DFS as samples of X(z)
    xn = real(idfs(Xk,N));                          % IDFS
    xtilde = xn'*ones(1,1); xtilde = (xtilde(:))';  % Periodic sequence
    
    subplot(2,2,4); stem(0:39, xtilde); axis([0, 40, -0.1, 1.5]);
    xlabel('n'); ylabel('xtilde(n)'); grid on;
    title('N=40');
    %% ----------------------------------------------------------
    %%             END   N=40
    %% ----------------------------------------------------------
    

      运行结果:

    牢记: 1、如果你决定做某事,那就动手去做;不要受任何人、任何事的干扰。2、这个世界并不完美,但依然值得我们去为之奋斗。
  • 相关阅读:
    Oracle OCP提纲
    Oracle redo 日志损坏的几种情况下的恢复
    Oracle 归档开启切换和归档日志删除(单实例和RAC)
    MySQL mysqldump备份与恢复
    Oracle 卸载
    MySQL脚本自动安装mysql-5.6.15-linux-glibc2.5-x86_64.tar.gz
    Oracle session出现大量的inactive
    Oracle 备份与恢复基础
    NuGet 下载dll
    Azure Service Bus
  • 原文地址:https://www.cnblogs.com/ky027wh-sx/p/6130205.html
Copyright © 2011-2022 走看看