任务一
使用Matlab函数fourier()计算f(t)=e−2∣t∣ 的傅里叶变换,用函数ifourier()计算F(ω)=1+ω21 傅里叶反变换。
由傅里叶变换对e−a∣t∣↔a2+ω2a2 可知:
f(t)=e−2∣t∣的傅里叶变换为4+ω24
F(ω)=1+ω21 傅里叶反变换21e−∣t∣
1 2 3 4 5 6 7 8 9 10 11
| syms t; Fw1=fourier(exp(-2*abs(t))); figure(1); ezplot(Fw1); xlabel('w/rad/s'),ylabel('F1(w)');
syms w ft2=ifourier(1/(1+w^2)); figure(2); ezplot(ft2); xlabel('t/s'),ylabel('f(t)');
|
任务二
计算f1(t)=21e−2tϵ(t) 和f2(t)=21e−2(t−1)ϵ(t−1) 的傅里叶变换,画出其幅度谱和相位谱,并观察傅里叶变换的时移特性。(注:其它可能使用到的函数有abs(), angle(),heaviside())
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| clc,clear all,close all; syms t w;
f1t=exp(-2*t)*heaviside(t);
f2t=exp(-2*(t-1))*heaviside(t-1);
figure(1); subplot(211) ezplot(f1t); xlabel('t/s'),ylabel('f1t');title('f1(t)');grid on; subplot(212) ezplot(f2t); xlabel('t/s'),ylabel('f1t');title('f2(t)');grid on;
F1w=fourier(f1t);
figure(2) subplot(221) ezplot(abs(F1w)); xlabel('w/rad/s');ylabel('|F1w|');title('F1(w)幅度谱');grid on;
subplot(222) ezplot(angle(F1w)*180/pi); xlabel('w/rad/s');ylabel('相位/°');title('F1(w)相位谱');grid on;
F2w=fourier(f2t);
subplot(223) ezplot(abs(F2w)); xlabel('w/rad/s');ylabel('|F2w|');title('F2(w)幅度谱');grid on;
subplot(224) ezplot(angle(F2w)*180/pi); xlabel('w/rad/s');ylabel('相位/°');title('F2(w)相位谱');grid on;
|
由图1可知,在时域,f2 的图像是f1 的图像进行右移的结果;
由图2可得,在频域,F1 和F2 的幅度谱图像一致,相位谱有较大差别。
任务三
计算f1(t)=g4(t) 、f2(t)=cos(ωct) 以及f3(t)=g4(t)cos(ωct) 的傅里叶变换, 其中ωc=100Hz ,画出三个信号的幅度谱,并观察讨论它们之间的关系。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| clc,clear all,close all; syms t w; wc=2*pi*100;
g4t=heaviside(t+2)-heaviside(t-2);
f2t=cos(wc*t);
f3t=g4t*f2t;
figure(1) subplot(311) ezplot(g4t); axis([-6 6 -1.3 1.3]); xlabel('t/s'),ylabel('幅度');title('g4(t)');grid on; subplot(312) ezplot(f2t); axis([-6 6 -1.3 1.3]); xlabel('t/s'),ylabel('幅度');title('f2(t)');grid on; subplot(313) ezplot(f3t); axis([-6 6 -1.3 1.3]); xlabel('t/s'),ylabel('幅度');title('g4(t)');grid on;
F1w=fourier(g4t);
figure(2) subplot(311) ezplot(abs(F1w),[-wc,wc,0,0.5]); xlabel('w/rad/s');ylabel('|F1w|');title('F1(w)幅度谱');grid on;
F2w=fourier(f2t);
subplot(312) ezplot(abs(F2w),[-2*wc,2*wc,0,1]); xlabel('w/rad/s');ylabel('|F2w|');title('F2(w)幅度谱');grid on;
F3w=fourier(f3t);
subplot(313) ezplot(abs(F3w),[-2*wc,2*wc,0,0.2]); xlabel('w/rad/s');ylabel('|F3w|');title('F2(w)幅度谱');grid on;
|