信号与系统matlab实验傅里叶分析及应用报告答案

更新时间:2023-12-02 18:24:01 阅读量: 教育文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

实验二 傅里叶分析及应用

姓名学号班级

一、实验目的

(一)掌握使用Matlab进行周期信号傅里叶级数展开和频谱分析

1、学会使用Matlab分析傅里叶级数展开,深入理解傅里叶级数的物理含义 2、学会使用Matlab分析周期信号的频谱特性

(二)掌握使用Matlab求解信号的傅里叶变换并分析傅里叶变换的性质

1、学会运用Matlab求连续时间信号的傅里叶变换 2、学会运用Matlab求连续时间信号的频谱图

3、学会运用Matlab分析连续时间信号的傅里叶变换的性质 (三) 掌握使用Matlab完成信号抽样并验证抽样定理

1、学会运用MATLAB完成信号抽样以及对抽样信号的频谱进行分析 2、学会运用MATLAB改变抽样时间间隔,观察抽样后信号的频谱变化 3、学会运用MATLAB对抽样后的信号进行重建

二、实验条件

需要一台PC机和一定的matlab编程能力

三、实验内容

2、分别利用Matlab符号运算求解法和数值计算法求下图所示信号的FT,并画出其频谱图(包括幅度谱和相位谱)[注:图中时间单位为:毫秒(ms)]。

1

符号运算法: Ft=

sym('t*(Heaviside(t+2)-Heaviside(t+1))+Heaviside(t+1)-Heaviside(t-1)+(-t)*(Heaviside(t-1)-Heaviside(t-2))'); Fw = fourier(Ft); ezplot(abs(Fw)),grid on; phase = atan(imag(Fw)/real(Fw)); ezplot(phase);grid on; title('|F|'); title('phase');

3、试用Matlab命令求F(j?)?

104-的傅里叶反变换,并绘出其时域信号图。

3?j?5?j?2

[注意:(1)写代码时j?i]

syms t

Fw = sym('10/(3+iw)-4/(5+iw)'); ft = ifourier(Fw,t); F = abs(ft);

ezplot(F,[-3,3]),grid on;

4、已知门函数自身卷积为三角波信号,试用Matlab命令验证FT的时域卷积定理。 [注:即验证门函数FT的平方与相应三角波信号的FT后结果是否一致,可结合频谱图观察分析]

3

f = sym('Heaviside(t+1)-Heaviside(t-1)'); Fw = simplify(fourier(f)); F = Fw.*Fw;

ezplot(abs(F)),grid on title('Fw*Fw');

triangle = sym('(t+2)*Heaviside(t+2)-2*t*Heaviside(t)+(t-2)*Heaviside(t-2)'); Fttriangle = fourier (triangle); F = simplify (Fttriangle); ezplot(abs(F),[-6,6]),grid on; title('triangle FT');

Hz;现在使用5、设有两个不同频率的余弦信号,频率分别为f1?100Hz,f2?3800Hz对这三个信号进行抽样,使用MATLAB命令画出各抽样信号的波形抽样频率fs?4000和频谱,并分析其频率混叠现象[建议:抽样信号的频谱图横坐标范围不小于-10000Hz~10000Hz或-20000*pi~20000*pi rad/s]。

F1=100Hz时,

实验代码如下:

Ts=1/4000;

4

dt=0.0001;

t1=-0.006:dt:0.006; ft=cos(2*pi*100*t1); subplot(221); plot(t1,ft),grid on;

axis([-0.006 0.006 -1.6 1.6]); xlabel('Time(sec)'),ylabel('f(t)') title('余弦信号波形');N=5000; k=-N:N;

W=2*pi*k/((2*N+1)*dt); Fw=dt*ft*exp(-j*t1'*W); subplot(222); plot(W,abs(Fw)); grid on;

axis([-20000 20000 0 0.006]); xlabel('\\omega'),ylabel('F(w)'); title('余弦信号的频谱'); t2=-0.006:Ts:0.006; fst=cos(2.*pi.*100*t2); subplot(223)

plot(t1,ft,':'),hold on stem(t2,fst),grid on

axis([-0.006 0.006 -1.5 1.5])

xlabel('Time (sec)'),ylabel('fs(t)') title('抽样后的信号'),hold off Fsw=Ts*fst*exp(-j*t2'*W); subplot(224)

plot(W,abs(Fsw)),grid on axis([-20000 20000 0 0.006]) xlabel('\\omega'),ylabel('Fsw') title('抽样信号的频谱')

5

F2=3800Hz时,

实验代码如下: Ts=1/4000; dt=0.0001;

t1=-0.006:dt:0.006; ft=cos(2*pi*3800*t1); subplot(221); plot(t1,ft),grid on;

axis([-0.006 0.006 -1.6 1.6]); xlabel('Time(sec)'),ylabel('f(t)') title('余弦信号波形');N=5000; k=-N:N;

W=2*pi*k/((2*N+1)*dt); Fw=dt*ft*exp(-j*t1'*W); subplot(222); plot(W,abs(Fw)); grid on;

axis([-20000 20000 0 0.006]); xlabel('\\omega'),ylabel('F(w)'); title('余弦信号的频谱'); t2=-0.006:Ts:0.006; fst=cos(2.*pi.*100*t2);

6

subplot(223)

plot(t1,ft,':'),hold on stem(t2,fst),grid on

axis([-0.006 0.006 -1.5 1.5])

xlabel('Time (sec)'),ylabel('fs(t)') title('抽样后的信号'),hold off Fsw=Ts*fst*exp(-j*t2'*W); subplot(224)

plot(W,abs(Fsw)),grid on axis([-20000 20000 0 0.006]) xlabel('\\omega'),ylabel('Fsw') title('抽样信号的频谱')

(六) 结合抽样定理,利用MATLAB编程实现Sa(t)信号经过冲激脉冲抽样后得到的抽样信号fs?t?及其频谱[建议:冲激脉冲的周期分别取4*pi/3 s、pi s、2*pi/3 s三种情况对比],并利用fs?t?构建Sa(t)信号。

周期取4*pi/3 s:

7

周期取pi s:

wm=2;

wc=1.2*wm; Ts=4*pi/3; dt=0.1; t1=-4:dt:4;

ft=sinc(t1/pi).*( heaviside (t1+10)- heaviside (t1-10)); N=500; k=-N:N;

W=2*pi*k/((2*N+1)*dt); n=-100:100; nTs=n*Ts;

fst=sinc(nTs/pi).*( heaviside (nTs+10)- heaviside (nTs-10)); subplot(221);

plot(t1,ft,':'),hold on stem(nTs,fst),grid on axis([-4 4 -1 1]);

xlabel('Time (sec)'),ylabel('fs(t)') title('Sa(t)抽样后的信号'),hold off; Fsw=Ts*fst*exp(-j*nTs'*W); subplot(222)

8

plot(W,abs(Fsw),'c'),grid on axis([-10 10 -3 10])

xlabel('\\omega'),ylabel('Fsw') title('Sa(t)抽样信号的频谱') t=-10:dt:10;

f=fst*Ts*wc/pi*sinc((wc/pi)*(ones(length(nTs),1)*t-nTs'*ones(1,length(t)))); subplot(223);

plot(t,f,'m:'),grid on; axis([-10 10 -2 9]);

xlabel('t'),ylabel('f(t)');

title('由f(nTs)信号重建得到Sa(t)信号');

周期取2*pi/3 s: 实验代码如下: wm=2;

wc=1.2*wm; Ts=2*pi/3; dt=0.1; t1=-4:dt:4;

ft=sinc(t1/pi).*( heaviside (t1+10)- heaviside (t1-10)); N=500; k=-N:N;

W=2*pi*k/((2*N+1)*dt); n=-100:100;

9

nTs=n*Ts;

fst=sinc(nTs/pi).*( heaviside (nTs+10)- heaviside (nTs-10)); subplot(221);

plot(t1,ft,':'),hold on stem(nTs,fst),grid on axis([-4 4 -1 1]);

xlabel('Time (sec)'),ylabel('fs(t)') title('Sa(t)抽样后的信号'),hold off; Fsw=Ts*fst*exp(-j*nTs'*W); subplot(222)

plot(W,abs(Fsw),'c'),grid on axis([-10 10 -3 10])

xlabel('\\omega'),ylabel('Fsw') title('Sa(t)抽样信号的频谱') t=-10:dt:10;

f=fst*Ts*wc/pi*sinc((wc/pi)*(ones(length(nTs),1)*t-nTs'*ones(1,length(t)))); subplot(223);

plot(t,f,'m:'),grid on; axis([-10 10 -2 9]);

xlabel('t'),ylabel('f(t)');

title('由f(nTs)信号重建得到Sa(t)信号');

10

四、实验结论和讨论

信号的时域与频域呈离散与周期的对应关系。最低的抽样频率应该为2f,只要抽样间

隔不大于1/2t,时域中的波形就不会发生混叠。

五、实验思考

要时刻考虑使用的函数的参数列表的问题,这次试验一开始出现的问题就是参数不匹

配,本来应该输入字符串,我却输入了表达式,导致后来没办法画出函数图像。还有就是要选取适当的观察范围,有时候坐标长度选得不合适看不出结果。

11

本文来源:https://www.bwwdw.com/article/e7tt.html

Top