• 《DSP using MATLAB》Problem 4.14


    代码:

    %% ----------------------------------------------------------------------------
    %%            Output Info about this m-file
    fprintf('
    ***********************************************************
    ');
    fprintf('        <DSP using MATLAB> Problem 4.14 
    
    ');
    
    banner();
    %% ----------------------------------------------------------------------------
    
    %format rat;
    %% --------------------------------------------------------------------
    %%      using  the method on Page 110 to get the inverse-z transform
    %% --------------------------------------------------------------------
    b = [-2, 5.65, -2.88];
    a = [1, -0.1, 0.09, 0.648];
    
    [R, p, C] = residuez(b, a)
           Mp = (abs(p))'            % pole magnitudes
           Ap = (angle(p))'/pi       % pole angle in pi units
    
    
    [delta, n] = impseq(0, 0, 7);
    
    x_chk = filter(b, a, delta)
    
    figure('NumberTitle', 'off', 'Name', 'Problem 4.14 X(z) pole-zero')
    set(gcf,'Color','white'); 
    zplane(b, a);
    title('pole-zero plot'); grid on;
    
    
    %% -----------------------------------------------------------------
    %%        Now, we use the invCCPP function to get x(n) sequence
    %% -----------------------------------------------------------------
    [b11, a11] = residuez(R(1:2), p(1:2), C)
    
    b0 = b11(1); b1 = b11(2);         % numerator coefficient
    a1 = a11(2); a2 = a11(3);         % denumerator                 
    
    [As, Ac, r, v0] = invCCPP(b0, b1, a1, a2);
    
    %% ------------------------------------------------------------------------
    %%       x1(n)=Ac*(r^n)*cos(pi*v0*n)*u(n) + As*(r^n)*sin(pi*v0*n)*u(n)
    %% ------------------------------------------------------------------------
    n_start = 0; n_end = 7;
    n = [n_start : n_end];
    
    x1 = Ac * (r.^n) .* cos( pi * v0 .* n) .* stepseq(0, n_start, n_end) + As * (r.^n) .* sin(pi * v0 .* n ) .* stepseq(0, n_start, n_end);
    
    x_ori = x1 + R(3)*(p(3).^n) .* stepseq(0, n_start, n_end)
    

      运行结果:

            可见有一对复共轭极点和一个实数极点(-0.8),从零极点图也可看出:

            计算一对复共轭极点相对应的有理分式的分子分母的系数b11和a11;这里只显示原始时间序列的前8个元素:

            最后写出z变换表达式如下:

    牢记: 1、如果你决定做某事,那就动手去做;不要受任何人、任何事的干扰。2、这个世界并不完美,但依然值得我们去为之奋斗。
  • 相关阅读:
    hbase中double类型数据做累加
    kafka的分区模式?
    hive 定时加载分区
    在shell 中字符串,文件,数字的比较
    idea中maven依赖不能下载的解决办法
    Required field 'client_protocol' is unset! Struct:TOpenSessionReq(client_protocol:null, configuration:{use:database=default}) (state=08S01,code=0)
    SparkSQL ThriftServer服务的使用和程序中JDBC的连接
    hbase计数器
    hbase常用命令
    object not serializable (class: org.apache.kafka.clients.consumer.ConsumerRecord)
  • 原文地址:https://www.cnblogs.com/ky027wh-sx/p/8463180.html
Copyright © 2020-2023  润新知