zoukankan      html  css  js  c++  java
  • 《DSP using MATLAB》Problem 6.18

            代码:

    %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    %%            Output Info about this m-file
    fprintf('
    ***********************************************************
    ');
    fprintf('        <DSP using MATLAB> Problem 6.18 
    
    ');
    
    banner();
    %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    %format long;
    format short;
    fprintf('
     FIR filter DIRECT-form:     
    ');
    b = [2, 3, 5, -3, 0, 4, 0, 8, -7, 4]
    a = 1.0
    
    fprintf('
    Convert DIRECT-form to PARALLEL-form :     
    ');
    [C, Bp, Ap] = dir2par(b, a)
    
    if size(C)==0
      C = 0;
    end
    
    fprintf('
    Convert DIRECT-form to CASCADE-form :     
    ');
    [b0, Bc, Ac] = dir2cas(b, a) 
    
    fprintf('
    Convert TF-form to SOS-form :     
    ');
    [sos, g] = tf2sos(b, a)
    
    % ----------------------------------------------------------
    % NOTE: linear-phase can not use LATTICE-form
    % ----------------------------------------------------------
    fprintf('
    Convert DIRECT-form to All-Zero LATTICE-form :     
    ');
    [Klc] = dir2latc(b) 
    
    
    fprintf('
    Convert DIRECT-form to FREQUENCY-SAMPLE-form :     
    ');
    [Cfs, Bfs, Afs] = dir2fs(b) 
    
    
    % -----------------------------------------
    %     START check
    % -----------------------------------------
    n = [0:7];
    delta = impseq(0, 0, 7)
    %format long
    format  short
    hcas = casfiltr(b0, Bc, Ac, delta)
    
    hltc = latcfilt(Klc, delta)
    
    %hladr = ladrfilt(Klr, Clr, delta)
    
    hdir = filter(b, a, delta)
    % -------------------------------------------
    %       END check
    % -------------------------------------------
    

      运行结果:

    牢记: 1、如果你决定做某事,那就动手去做;不要受任何人、任何事的干扰。2、这个世界并不完美,但依然值得我们去为之奋斗。
  • 相关阅读:
    this指向问题
    原生js实现的金山打字小游戏(实例代码详解)
    js实现点赞效果
    .net core部署到linux可能碰到的问题
    Linux curl命令详解 Web程序
    用十年来学编程
    JAVA的字符串拼接与性能
    PHP学习的技巧和学习的要素总结
    php实现验证邮箱格式的代码实例
    PHP页面中文乱码处理办法
  • 原文地址:https://www.cnblogs.com/ky027wh-sx/p/9979274.html
Copyright © 2011-2022 走看看