代码:
%% -------------------------------------------------
%% 1 x(n)=2δ(n-2)+3u(n-3)
%% -------------------------------------------------
b = [0, 0, 2, 1]; a = [1, -1]; % [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); x1_chk = filter(b, a, delta) x1_ori = 2 * impseq(2, 0, 7) + 3 .* stepseq(3, 0, 7) figure('NumberTitle', 'off', 'Name', 'Problem 4.3 X1(z) pole-zero')
set(gcf,'Color','white');
zplane(b, a);
title('pole-zero plot'); grid on; %% ----------------------------------------------------------------------------
%% 2 x(n)=[3*0.75^n*cos(0.3πn)]u(n) + [4*0.75^n*sin(0.3πn)]u(n)
%% ----------------------------------------------------------------------------
b = [3, -3*0.75*cos(0.3*pi) + 4*0.75*sin(0.3*pi) ];
a = [1, -2*0.75*cos(0.3*pi), 0.75*0.75]; [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); x2_chk = filter(b, a, delta) x2_ori = ( 3*(0.75 .^ n) .* cos(0.3*pi*n) + 4*(0.75 .^ n) .* sin(0.3*pi*n) ) .* stepseq(0, 0, 7) figure('NumberTitle', 'off', 'Name', 'Problem 4.3 X2(z) pole-zero')
set(gcf,'Color','white');
zplane(b, a);
title('pole-zero plot'); grid on;
运行结果:
2、第2小题的z变换,有一对共轭极点;
3、求z变换
代码:
%% ------------------------------------------------------------------------
%% 3 x(n)=n*sin(πn/3)u(n) + (0.9)^n*u(n-2)
%% ------------------------------------------------------------------------
b1 = [0, sqrt(3)/2, 0, -sqrt(3)/2]; nb1 = [0:3];
a1 = [1, -2, 3, -2, 1]; na1 = [0:4];
b2 = [0, 0, 0.81]; nb2 = [0:2];
a2 = [1, -0.9]; na2 = [0:1]; [a, na] = conv_m(a1, na1, a2, na2); [b11, nb11] = conv_m(b1, nb1, a2, na2);
[b12, nb12] = conv_m(a1, na1, b2, nb2); [b, nb] = sigadd(b11, nb11, b12, nb12); [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); x3_chk = filter(b, a, delta) x3_ori = ( n .* sin(pi*n/3) ) .* stepseq(0, 0, 7) + (0.9 .^ n) .* stepseq(2, 0, 7) figure('NumberTitle', 'off', 'Name', 'Problem 4.3 X3(z) pole-zero')
set(gcf,'Color','white');
zplane(b, a);
title('pole-zero plot'); grid on;
运行结果:
4、求z变换
代码:
%% ------------------------------------------------------------------------
%% 4 x(n)=[n^2*(2/3)^(n-2)]u(n-1)
%% ------------------------------------------------------------------------
b1 = [0, 0, 1, 0, -4/9]; nb1 = [0:4];
a1 = [1, -8/3, 24/9, -32/27, 16/81]; na1 = [0:4];
b2 = [0, 3]; nb2 = [0:1];
a2 = [1, -4/3, 4/9]; na2 = [0:2];
b3 = [0, -3/2]; nb3 = [0:1];
a3 = [1, -2/3]; na3 = [0:1]; [a22, na22] = conv_m(a2, na2, a3, na3); [b11, nb11] = conv_m(b2, nb2, a3, na3);
[b12, nb12] = conv_m(b3, nb3, a2, na2); [b22, nb22] = sigadd(b11, nb11, b12, nb12); [a, na] = conv_m(a1, na1, a22, na22); [b13, nb13] = conv_m(b1, nb1, a22, na22);
[b14, nb14] = conv_m(a1, na1, b22, nb22); [b, nb] = sigadd(b13, nb13, b14, nb14); [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); x4_chk = filter(b, a, delta) x4_ori = (n.*n) .* (2/3).^(n-2) .* stepseq(1, 0, 7) figure('NumberTitle', 'off', 'Name', 'Problem 4.3 X4(z) pole-zero')
set(gcf,'Color','white');
zplane(b, a);
title('pole-zero plot'); grid on;
运行结果:
5、求z变换
代码: