《DSP using MATLAB》Problem 4.11

代码:

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

banner();
%% ----------------------------------------------------------------------------

format rat;
%% -------------------------------------------------
%%            1      X1(z)    rightsided
%% -------------------------------------------------

b = [1, -1, -4, 4];             nb = [0:3];
a = [1, -11/4, 13/8, -1/4];     na = [0:3];                 

%[p, r] = deconv(b, a)
%[p, np, r, nr] = deconv_m(b, nb, a, na)
[R, p, C] = residuez(b, a)

%[delta, n] = impseq(0,0,7);
%x = filter(b, a, delta)

%[b,a] = residuez(R, p, C)

%Mp = abs((p))‘
%Ap = angle((p))‘

figure(‘NumberTitle‘, ‘off‘, ‘Name‘, ‘Problem 4.11.1  X1(z)‘)
set(gcf,‘Color‘,‘white‘);
zplane(b, a);                                           % row vector
title(‘Zero-Pole Plot‘);  xlabel(‘Re‘); ylabel(‘Im‘); grid on;

fprintf(‘\n-------------------- X2(z) ------------------ \n\n‘);
%% -------------------------------------------------
%%            2      X2(z)    absolutely summable
%% -------------------------------------------------

b = [1, 1, -4, 4];              nb = [0:3];
a = [1, -11/4, 13/8, -1/4];     na = [0:3];                 

%[p, r] = deconv(b, a)
%[p, np, r, nr] = deconv_m(b, nb, a, na)
[R, p, C] = residuez(b, a)

%[delta, n] = impseq(0,0,7);
%x = filter(b, a, delta)

%[b,a] = residuez(R, p, C)

%Mp = abs((p))‘
%Ap = angle((p))‘

figure(‘NumberTitle‘, ‘off‘, ‘Name‘, ‘Problem 4.11.2 X2(z)‘)
set(gcf,‘Color‘,‘white‘);
zplane(b, a);                                           % row vector
title(‘Zero-Pole Plot‘);  xlabel(‘Re‘); ylabel(‘Im‘); grid on;

fprintf(‘\n-------------------- X3(z) ------------------ \n\n‘);
%% -------------------------------------------------
%%            3      X3(z)    leftsided
%% -------------------------------------------------

b = [1, -3, 4, 1];              nb = [0:3];
a = [1, -4, 1, -0.16];          na = [0:3];                 

%[p, r] = deconv(b, a)
%[p, np, r, nr] = deconv_m(b, nb, a, na)
[R, p, C] = residuez(b, a)

%[delta, n] = impseq(0,0,7);
%x = filter(b, a, delta)

%[b,a] = residuez(R, p, C)

Mp = abs((p))‘
Ap = angle((p))‘/pi              % pole angle in pi units

figure(‘NumberTitle‘, ‘off‘, ‘Name‘, ‘Problem 4.11.3 X3(z)‘)
set(gcf,‘Color‘,‘white‘);
zplane(b, a);                                           % row vector
title(‘Zero-Pole Plot‘);  xlabel(‘Re‘); ylabel(‘Im‘); grid on;

fprintf(‘\n-------------------- X4(z) ------------------ \n\n‘);
%% -------------------------------------------------
%%            4      X4(z)    leftsided
%% -------------------------------------------------

b = [0, 0, 1];                  nb = [0:2];
a = [1, 2, 1.25, 0.25];         na = [0:3];                 

%[p, r] = deconv(b, a)
%[p, np, r, nr] = deconv_m(b, nb, a, na)
[R, p, C] = residuez(b, a)

%[delta, n] = impseq(0,0,7);
%x = filter(b, a, delta)

%[b,a] = residuez(R, p, C)

%Mp = abs((p))‘
%Ap = angle((p))‘

figure(‘NumberTitle‘, ‘off‘, ‘Name‘, ‘Problem 4.11.4 X4(z)‘)
set(gcf,‘Color‘,‘white‘);
zplane(b, a);                                           % row vector
title(‘Zero-Pole Plot‘);  xlabel(‘Re‘); ylabel(‘Im‘); grid on;

fprintf(‘\n-------------------- X5(z) ------------------ \n\n‘);
%% -------------------------------------------------
%%            5      X5(z)    leftsided
%% -------------------------------------------------

b = [0, 0, 0, 1];                  nb = [0:3];
a = [1, 0, -0.5, 0, 0.25*0.25];    na = [0:3];                 

%[p, r] = deconv(b, a)
%[p, np, r, nr] = deconv_m(b, nb, a, na)
[R, p, C] = residuez(b, a)

%[delta, n] = impseq(0,0,7);
%x = filter(b, a, delta)

%[b,a] = residuez(R, p, C)

%Mp = abs((p))‘
%Ap = angle((p))‘

figure(‘NumberTitle‘, ‘off‘, ‘Name‘, ‘Problem 4.11.5 X5(z)‘)
set(gcf,‘Color‘,‘white‘);
zplane(b, a);                                           % row vector
title(‘Zero-Pole Plot‘);  xlabel(‘Re‘); ylabel(‘Im‘); grid on;

  运行结果:

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

时间: 2024-10-07 07:31:26

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

《DSP using MATLAB》Problem 5.11

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

《DSP using MATLAB》Problem 6.11

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

《DSP using MATLAB》Problem 7.11

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

《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 3.1

先写DTFT子函数: function [X] = dtft(x, n, w) %% ------------------------------------------------------------------------ %% Computes DTFT (Discrete-Time Fourier Transform) %% of Finite-Duration Sequence %% Note: NOT the most elegant way % [X] = dtft(x, n,

《DSP using MATLAB》Problem 5.14

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

《DSP using MATLAB》Problem 5.21

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

《DSP using MATLAB》Problem 7.36

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

《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