一、实验内容
(1)仔细阅读并验证执行程序示例
syms t
Fw=fourier(exp(-2*abs(t)))
syms t w
ft=ifourier(1/(1+w^2),t)
ft=4*cos(12*pi*t)*(heaviside(t+1/4)-heaviside(t-1/4));
Fw=simplify(fourier(ft))
subplot(121)
ezplot(ft,[-0.5 0.5]),grid on
subplot(122)
ezplot(abs(Fw),[-24*pi 24*pi]),grid
w=0:0.025:5;
b=[1];a=[1,2,2,1];
H=freqs(b,a,w);
subplot(2,1,1);
plot(w,abs(H));grid;
xlabel('\omega(rad/s)');
ylabel('|H(j\omega)|');
title('H(jw)的幅频特性');
subplot(2,1,2);
plot(w,angle (H));grid;
xlabel('\omega(rad/s)');
ylabel('\phi(\omega)');
title('H(jw)的相频特性');
RC=0.04;
t=linspace(-2,2,1024);
w1=5;w2=100;
H1=j*w1/(j*w1+1/RC);
H2=j*w2/(j*w2+1/RC);
f=cos(5*t)+cos(100*t);
y=abs(H1)*cos(w1*t+angle(H1))+ abs(H2)*cos(w2*t+angle(H2));
subplot(2,1,1);
plot(t,f);
ylabel('f(t)');
xlabel('Time(s)');
subplot(2,1,2);
plot(t,y);
ylabel('y(t)');
xlabel('Time(s)');
num=[1];
den=[1,2,2,1];
sys=tf(num,den);
figure(1);pzmap(sys);
t=0:0.02:10;
h=impulse(num,den,t);
figure(2);plot(t,h)
title('Impulse Response')
[H,w]=freqs(num,den);
figure(3);plot(w,abs(H))
xlabel('\omega')
title('Magnitude Response')
syms a t
F=laplace(exp(-t)*sin(a*t))
syms s
ft= ilaplace(s^2/(s^2+1))
A=[1 7 17 17 6];
B=[1 0 4];
p=roots(A);
q=roots(B);
p=p';
q=q';
x=max(abs([p,q]));
x=x+0.1;
y=x;
clf
hold on
axis([-x,x,-y,y])
axis('square')
plot([-x x],[0 0])
plot([0 0],[-y y])
plot(real(p),imag(p),'x')
plot(real(q),imag(q),'o')
title('连续时间系统的零极点图')
text(0.2,x-0.2,'虚轴');
text(y-0.2,0.2,'实轴');
syms t
Fw=fourier(exp(-2*t)*heaviside(t))
f=abs(Fw);
ezplot(f,[-10*pi,10*pi])
axis([-10*pi,10*pi,0,0.6])
w=0:0.025:5;
b=[1];a=[0,0.08,0.4,1];
H=freqs(b,a,w);
subplot(2,1,1);
plot(w,abs(H));grid;
xlabel('\omega(rad/s)');
ylabel('|H(j\omega)|');
title('H(jw)的幅频特性');
subplot(2,1,2);
plot(w,angle (H));grid;
xlabel('\omega(rad/s)');
ylabel('\phi(\omega)');
title('H(jw)的相频特性');
syms a t
F=laplace(t*exp((-3)*t*heaviside(t)))
syms s
ft= ilaplace((s^3+5*s^2+9*s+7)/(s^2+3*s+2))
A=[3 5 4 6];
B=[1 1 2];
p=roots(A);
q=roots(B);
p=p';
q=q';
x=max(abs([p,q]));
x=x+0.1;
y=x;
clf
hold on
axis([-x,x,-y,y])
axis('square')
plot([-x x],[0 0])
plot([0 0],[-y y])
plot(real(p),imag(p),'x')
plot(real(q),imag(q),'o')
title('连续时间系统的零极点图')
text(0.2,x-0.2,'虚轴');
text(y-0.2,0.2,'实轴');
标签:subplot,plot,title,0.2,系统,频域,abs,MATLAB,omega
From: https://blog.csdn.net/lengmei1/article/details/141191965