好吧,这个是真的不会

This commit is contained in:
iridiumR 2022-05-11 21:19:35 +08:00
parent 9588208479
commit 094bb164f7
2 changed files with 34 additions and 40 deletions

View File

@ -13,14 +13,9 @@ fz=heaviside(x+0.1)-heaviside(x-0.1);
ezplot(fz,[-5,5]);
figure(4);
subplot(2,1,1);
fa=5*cos(12*pi*t)+6*cos(18*pi*t);
plot(t,fa);
subplot(2,1,2);
xcorr1=autocorr(fa,t);
plot(corr1);
figure(5);
fb=(cos(2*pi*t)).*(cos(2*pi*t));
plot(t,fb);
@ -46,6 +41,7 @@ sys=tf([1,2],[1,3,2]);
y=impulse(sys,t);
plot(t,y);
figure(8);
f=cos(t);
sys=tf([-1,2],[1,3,2]);
y=lsim(sys,f,t);

View File

@ -9,81 +9,78 @@ yb1=f1*sin(n*2*pi/T*t);
yb2=f2*sin(n*2*pi/T*t);
an=(int(ya1,-T/2,0)+int(ya2,0,T/2))/T*2;
bn=(int(yb1,-T/2,0)+int(yb2,0,T/2))/T*2;
%1.2齿
cn=(an^2+bn^2)^(1/2);
n=1:10;
cn1=subs(cn);
cn2=[0,cn1];
h=stem([0,n],cn2);
hold on;
plot([0,n],cn2)
title('')
xlabel('\omega');
ylabel('c_n');
%an00anpi
figure(2);
syms t w;
syms t;
ft=exp(-3*t)*heaviside(t);
subplot(2,2,1);
subplot(3,1,1);
ezplot(ft);
title('f(t)=e^-^3^tu(t)');
title('');
xlabel('t');
ylabel('f(t)');
Fw=fourier(ft);
F=fourier(ft);
w=-3:0.01:3;
Fw1=subs(Fw);
subplot(2,2,2);
plot(w,abs(Fw1));
F1=subs(F);
subplot(3,1,2);
plot(w,abs(F1));
title('');
xlabel('(\omega)');
xlabel('');
ylabel('');
subplot(2,2,3);
plot(w,angle(Fw1)*pi/180);
subplot(3,1,3);
plot(w,angle(F1)*pi/180);
title('');
xlabel('(\omega)');
ylabel('\phi');
xlabel('');
ylabel('');
figure(3);
syms t w tao;
syms t w;
tao=3;
Fw=tao*sin(tao*w/2)/(tao*w/2);
ft=ifourier(Fw,t);
F=tao*sin(tao*w/2)/(tao*w/2);
ft=ifourier(F,t);
subplot(2,2,1);
ezplot(ft,[-2,2]);
title('f(t)');
title('');
xlabel('t');
ylabel('f(t)');
subplot(2,2,2);
ezplot(Fw,[-10,10]);
ezplot(F,[-10,10]);
title('');
xlabel('\omega');
subplot(2,2,3);
ezplot(abs(Fw),[-10,10]);
ezplot(abs(F),[-10,10]);
title('');
xlabel('(\omega)');
xlabel('');
ylabel('');
subplot(2,2,4);
ezplot(angle(Fw),[-10,10]);
ezplot(angle(F),[-10,10]);
title('');
xlabel('\omega');
ylabel('\phi');
ylabel('');
figure(4);
syms w t;
Fw=(1-j*w)/(1+j*w);
F=(1-j*w)/(1+j*w);
w=-5:0.01:5;
Fw1=subs(Fw);
F1=subs(F);
subplot(2,1,1);
plot(w,abs(Fw1));
plot(w,abs(F1));
title('');
xlabel('(\omega)');
ylabel('|H(j\omega)|');
subplot(2,1,2);
plot(w,angle(Fw1)*pi/180);
plot(w,angle(F1)*pi/180);
xlabel('(\omega)');
ylabel('\phi');
@ -101,27 +98,28 @@ ylabel('h(t)');
ft=exp(-2*t)*heaviside(t);
subplot(2,2,2);
ezplot(ft);
title('f(t)=e^-^2^tu(t)');
title('');
xlabel('t');
ylabel('f(t)');grid on;
Fw=fourier(ft);
Yw=Fw*Hw;
F=fourier(ft);
Yw=F*Hw;
yt=ifourier(Yw,t);
subplot(2,2,3);
ezplot(yt,[-1,4,-1,0.5]);
title('');
xlabel('t');
ylabel('y_f(t)');grid on;
ylabel('y_f(t)');
figure(6);
syms w t;
ft=exp(-2*t)*heaviside(t);
subplot(1,2,1);
ezplot(ft);
title('e^-^2^tu(t)');
title('F');
xlabel('t');
ylabel('f(t)');grid on;
Fw=fourier(ft);
Yw=Fw*Hw;
F=fourier(ft);
Yw=F*Hw;
yt=ifourier(Yw,t);
subplot(1,2,2);
ezplot(yt,[-1,4,-1,0.5]);