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

    代码:

    %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    %%            Output Info about this m-file
    fprintf('
    ***********************************************************
    ');
    fprintf('        <DSP using MATLAB> Problem 6.13 
    
    ');
    
    banner();
    %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    b1 = [0.5   2.0  1.5]; a1 = [1.0   1.0  0.9];
    b2 = [1.0   3.0];      a2 = [1.0  -1.0  0.8];
    b3 = [1.0   2.0  1.0]; a3 = [1.0  0.5  0.5  -0.4];
    b4 = [3.0  -0.5  2.0]; a4 = [1.0  0.4  0.4];   
    
    a12 = conv(a1, a2); b12 = conv(b1, b2);
    a34 = conv(a3, a4); b34 = conv(b3, b4);
    
    format short;
    fprintf('
    DIRECT-form:     
    ');
    a = conv(a12, a34)
    b = conv(b12, a34)+ conv(b34, a12)
    
    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)
    
    fprintf('
    Convert DIRECT-form to LATTICE-LADDER-form :     
    ');
    [Klr, Clr] = dir2ladr(b, a) 
    
    fprintf('
    Convert DIRECT-form to MATLAB LATTICE-LADDER-form :     
    ');
    [K, V] = tf2latc(b, a)
    
    % -----------------------------------------
    %     START check
    % -----------------------------------------
    n = [0:7];
    delta = impseq(0, 0, 7)
    %format long
    format  short
    hcas = casfiltr(b0, Bc, Ac, delta)
    
    hpar = parfiltr(C, Bp, Ap, delta)
    
    hladr = ladrfilt(Klr, Clr, delta)
    
    hdir = filter(b, a, delta)
    % -------------------------------------------
    %       END check
    % -------------------------------------------
    
    fprintf('
    Convert CASCADE-form to DIRECT-form:     
    ');
    [b_c2d, a_c2d] = cas2dir(b0, Bc, Ac) 
    
    fprintf('
    Convert SOS-form to TF-form :     
    ');
    [b_s2t, a_s2t] = sos2tf(sos, g)
    

      运行结果:

           直接形式系数

            并联形式系数

             串联形式系数

    牢记: 1、如果你决定做某事,那就动手去做;不要受任何人、任何事的干扰。2、这个世界并不完美,但依然值得我们去为之奋斗。
  • 相关阅读:
    -----------------------------2015年 年度总结-----------------------------
    ------第二节-----------------第二讲----单链表的基本操作---------
    shell 字符串截取
    express, mocha, supertest,istanbul
    Qunit 和 jsCoverage使用方法(js单元测试)
    jsp tutorial
    Unicode 和 UTF-8 是什么关系?
    wget -d --header
    python array
    responsive and functional programming RxJava
  • 原文地址:https://www.cnblogs.com/ky027wh-sx/p/9639963.html
Copyright © 2011-2022 走看看