Complex frequency domain analysis of signals and systems
Experiment content
Experiment content
Code
Code
1(1)
clear;
clc;
syms t s;
f=2*exp(-t)*heaviside(t)+5*exp(-3*t)*heaviside(t);
Fs=laplace(f)
1(2)
clear;
clc;
syms s t;
Fs=(2*(s-3)*(s+3))/((s-5)*(s^2+16));
ft=ilaplace(Fs)
1(3)
clear;
clc;
syms k z
f=(0.5^k)*cos(k*pi/2);
Fz=ztrans(f)
1(4)
clear;
clc;
syms z k;
Fz=(z*(z^2+z+1))/((z+1)*(z-2)*(z+3));
fk=iztrans(Fz,k)
2(1)
clear;
clc;
num=[1,0,-1,0];
den=[1,2,3,2,1];
[r p k]=residue(num,den)
%零极点
b=[1,0,-1,0];%分母 降幂
a=[1,2,3,2,1];
zs=roots(b)
ps=roots(a)
plot(real(zs), imag(zs), 'o', real(ps),imag(ps),'rx' ,'markersize' , 12);
axis([-2,2,-2,2]);
grid;
legend('零点','极点');
2(2)
clear;
clc;
%部分分式
num=[1,8,22,28,16];
den=[1,1,-5,6,-4];
[r p k]=residuez(num,den)
%零极点
b=[1,8,22,28,16];%分母 降幂
a=[1,1,-5,6,-4];
[r1 p1 k1]=tf2zp(b,a)
zplane(b,a)
3(1)
num=[1,0,1]; %分子
den=[1,3,2,1,1];%分母 降幂
sys=tf(num, den);
zeros=roots(num);
poles=roots(den);
figure(1);
pzmap(sys);
t=0:0.02:10;
h=impulse(num, den, t);
figure(2);
plot(t,h)
title('冲激响应')
[H,w]=freqs(num,den);
figure(3); plot(w, abs(H))
xlabel('omega' )
title(' 频率响应')
3(2)
num=[1,0,-1,0]; %分子
den=[1,2,3,2,1];%分母 降幂
sys=tf(num, den);
zeros=roots(num);
poles=roots(den);
figure(1);
pzmap(sys);
t=0:0.01:10;
h=impulse(num, den, t);
figure(2);
plot(t,h)
title('冲激响应')
[H,w]=freqs(num,den);
figure(3); plot(w, abs(H))
xlabel('omega' )
title(' 频率响应')
3(3)
b=[2,16,44,56,32];%分子
a=[3,3,-15,18,-12];%分母
figure(1);
zplane(b, a);
num=[2,16,44,56,32];
den=[3,3,-15,18,-12];
h=impz(num, den);
figure(2);
stem(h ,'o')
xlabel('k')
title('单位序列响应')
[H,w]=freqz(num,den);
figure(3);
plot(w/pi,abs(H))
xlabel(' Frequency\omega')
title('频率响应')
3(4)
b=[0,1,0,0,3];%分子
a=[1,2,3,3,2,2];%分母
figure(1);
zplane(b, a);
num=[0,1,0,0,3];
den=[1,2,3,3,2,2];
h=impz(num, den);
figure(2);
stem(h ,'.')
xlabel('k')
title('单位序列响应')
[H,w]=freqz(num,den);
figure(3);
plot(w/pi,abs(H))
xlabel(' Frequency\omega')
title('频率响应')
Since there are many output results, I will not show them here!