《DSP using MATLAB》Problem 4.14

代码:

%% ----------------------------------------------------------------------------
%%            Output Info about this m-file
fprintf(‘\n***********************************************************\n‘);
fprintf(‘        <DSP using MATLAB> Problem 4.14 \n\n‘);

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变换表达式如下:

原文地址:https://www.cnblogs.com/ky027wh-sx/p/8463180.html

时间: 2024-11-04 08:40:45

《DSP using MATLAB》Problem 4.14的相关文章

《DSP using MATLAB》Problem 2.14

代码: %% ------------------------------------------------------------------------ %% Output Info about this m-file fprintf('\n***********************************************************\n'); fprintf(' <DSP using MATLAB> Problem 2.14 \n\n'); banner();

《DSP using MATLAB》Problem 5.14

说明:这两个小题的数学证明过程都不会,欢迎博友赐教. 直接上代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output Info about this m-file fprintf('\n***********************************************************\n'); fprintf(' <DSP using MA

《DSP using MATLAB》Problem 5.7

代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output Info about this m-file fprintf('\n***********************************************************\n'); fprintf(' <DSP using MATLAB> Problem 5.7 \n\n'); ban

《DSP using MATLAB》 Problem 2.3

本题主要是显示周期序列的. 1.代码: %% ------------------------------------------------------------------------ %% Output Info about this m-file fprintf('\n***********************************************************\n'); fprintf(' <DSP using MATLAB> Problem 2.3.1 \

《DSP using MATLAB》Problem 2.5

2.代码: %% ------------------------------------------------------------------------ %% Output Info about this m-file fprintf('\n***********************************************************\n'); fprintf(' <DSP using MATLAB> Problem 2.5.2 \n\n'); time_st

《DSP using MATLAB》Problem 2.6

1.代码 %% ------------------------------------------------------------------------ %% Output Info about this m-file fprintf('\n***********************************************************\n'); fprintf(' <DSP using MATLAB> Problem 2.6.1 \n\n'); [v, d] =

《DSP using MATLAB》Problem 2.8

1.代码: 从MATLAB官方网上下载的. %*************************************************************************% %A code for the Downsampler% %Author: Yashwant Marathe% %Date:20-12-2010% function [y ny] = dnsample(x,n,M) %x is a sequence over indices specified by v

《DSP using MATLAB》Problem 2.16

先由脉冲响应序列h(n)得到差分方程系数,过程如下: 代码: %% ------------------------------------------------------------------------ %% Output Info about this m-file fprintf('\n***********************************************************\n'); fprintf(' <DSP using MATLAB> Prob

《DSP using MATLAB》Problem 2.15

代码: %% ------------------------------------------------------------------------ %% Output Info about this m-file fprintf('\n***********************************************************\n'); fprintf(' <DSP using MATLAB> Problem 2.15 \n\n'); banner();