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

    代码:

    x1 = [1,2,2,1]; x2 = [1,-1,-1,1]; 
    x3 = conv(x1,x2);             % N = 5
    
    n1 = 0:1:length(x1)-1;
    n2 = 0:1:length(x2)-1;
    
    n3 = 0:1:length(x3)-1;
    
    %% -----------------------------------------------------------------
    %%                  START   a
    %% -----------------------------------------------------------------
    figure('NumberTitle', 'off', 'Name', 'Exameple5.16a ')
    set(gcf,'Color','white'); 
    subplot(3,1,1); stem(n1,x1); title('sequence x1(n)'); axis([0,5,0,5]);
    xlabel('n'); ylabel('x1(n)'); grid on;
    subplot(3,1,2); stem(n2,x2); title('sequence x2(n)'); axis([0,5,0,5]);
    xlabel('n'); ylabel('x2(n)'); grid on;
    subplot(3,1,3); stem(n3,x3); title('Linear Convolution sequence x3(n)'); axis([0,10,-3,5]);
    xlabel('n'); ylabel('x3(n)'); grid on;
    
    
    %% -----------------------------------------------------------------
    %%                  END   a
    %% -----------------------------------------------------------------
    
    
    x4 = circonvt(x1,x2,7);            % N = 7
    
    n4 = 0:1:length(x4)-1;
    
    %% -----------------------------------------------------------------
    %%                  START   b
    %% -----------------------------------------------------------------
    figure('NumberTitle', 'off', 'Name', 'Exameple5.16b ')
    set(gcf,'Color','white'); 
    subplot(3,1,1); stem(n1,x1); title('sequence x1(n)'); axis([0,5,0,5]);
    xlabel('n'); ylabel('x1(n)'); grid on;
    subplot(3,1,2); stem(n2,x2); title('sequence x2(n)'); axis([0,5,0,5]);
    xlabel('n'); ylabel('x2(n)'); grid on;
    subplot(3,1,3); stem(n4,x4); title('Circularly convolution sequence x4(n)'); axis([0,10,-3,5]);
    xlabel('n'); ylabel('x4(n)'); grid on;
    
    
    %% -----------------------------------------------------------------
    %%                  END   b
    %% -----------------------------------------------------------------
    

      运行结果:

    牢记: 1、如果你决定做某事,那就动手去做;不要受任何人、任何事的干扰。2、这个世界并不完美,但依然值得我们去为之奋斗。
  • 相关阅读:
    Element ui表单验证结束后再次打开清空验证信息
    oracle 新建用户 给用户设定权限
    oracle时间问题
    ORACLE 创建作业JOB例子
    ORACLE SQL PLUSE 创建作业 执行作业
    VS发布,签名出错 试图加载该页时出错,路径的形式不合法。
    Oracle 系统权限
    PL/SQL Developer 8.0 创建 Oracle Jobs 的疑惑
    信息系统系项目管理考试技巧
    水晶报表分组统计中如何让字段值居中显示
  • 原文地址:https://www.cnblogs.com/ky027wh-sx/p/6163129.html
Copyright © 2011-2022 走看看