900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > 信号与系统仿真实验——实验二 傅立叶变换MATLAB的实现及傅里叶变换性质的分析

信号与系统仿真实验——实验二 傅立叶变换MATLAB的实现及傅里叶变换性质的分析

时间:2018-11-10 17:33:17

相关推荐

信号与系统仿真实验——实验二 傅立叶变换MATLAB的实现及傅里叶变换性质的分析

【 实验目的】

1.利用MATLAB分析非周期信号的频谱

2.观察信号频谱变化验证傅里叶变换性质

【 实验内容】

【 实验报告要求】

(1)记录实验一和实验三中的波形;

(2)总结实验二中频谱特性曲线变化的特点;

(3)实验目的和实验过程进行总结。

Matlab程序一:

f=sym('exp(-2*t)*heaviside(t)');%方程F=fourier(f);%傅里叶变换FT=subs(F,[-2*pi:0.01*pi:2*pi]);%subs()函数来得到傅立叶变换的数值解subplot(4,2,1); %作图区域划分 plot([-2*pi:0.01*pi:2*pi],abs(FT));%绘制幅频特性曲线title('幅频曲线-Make by 磊');xlabel('w');ylabel('幅度');subplot(4,2,2);%作图区域划分 plot([-2*pi:0.01*pi:2*pi],angle(FT));%绘制相频特性曲线title('相频曲线-Make by 磊');xlabel('w');ylabel('相位(弧度)');grid on; f=sym('exp(-3*abs(t))'); %方程F=fourier(f);%傅里叶变换FT=subs(F,[-2*pi:0.01*pi:2*pi]);%subs()函数来得到傅立叶变换的数值解subplot(4,2,3);%作图区域划分plot([-2*pi:0.01*pi:2*pi],abs(FT));%绘制幅频特性曲线title('幅频曲线-Make by 磊');xlabel('w');ylabel('幅度');subplot(4,2,4);%作图区域划分 plot([-2*pi:0.01*pi:2*pi],angle(FT));%绘制相频特性曲线title('相频曲线-Make by 磊');xlabel('w');ylabel('相位(弧度)');grid on;f=sym('heaviside(t+2)-heaviside(t-2)');%方程 F=fourier(f);%傅里叶变换t1=-10*pi:0.01*pi:-0.001;t2=0.001*pi:0.01*pi:10*pi;t=[t1 t2];FT=subs(F,t);%subs()函数来得到傅立叶变换的数值解subplot(4,2,5);%作图区域划分 plot(t,abs(FT));%绘制幅频特性曲线title('幅频曲线-Make by 磊');xlabel('w');ylabel('幅度');grid on;subplot(4,2,6);%作图区域划分 plot(t,angle(FT));%绘制相频特性曲线title('相频曲线-Make by 磊');xlabel('w');ylabel('相位(弧度)');grid on;f=sym('sin(2*t)/(2*pi*t)');%方程 F=fourier(f);%傅里叶变换FT=subs(F,[-2*pi:0.01*pi:2*pi]);%subs()函数来得到傅立叶变换的数值解subplot(4,2,7);%作图区域划分plot([-2*pi:0.01*pi:2*pi],abs(FT));%绘制幅频特性曲线title('幅频曲线-Make by 磊');xlabel('w');ylabel('幅度');subplot(4,2,8);%作图区域划分 plot([-2*pi:0.01*pi:2*pi],angle(FT));%绘制相频特性曲线title('相频曲线-Make by 磊');xlabel('w');ylabel('相位(弧度)');grid on;

运行结果一:

Matlab程序二:

f=sym('exp(-2*t)*heaviside(t)');%方程F=fourier(f);%傅里叶变换FT=subs(F,[-2*pi:0.01*pi:2*pi]);%subs()函数来得到傅立叶变换的数值解subplot(3,2,1);%作图区域划分plot([-2*pi:0.01*pi:2*pi],abs(FT));%绘制幅频特性曲线title('幅频曲线-Make by 磊');xlabel('w');ylabel('幅度');subplot(3,2,2); %作图区域划分 plot([-2*pi:0.01*pi:2*pi],angle(FT));%绘制相频特性曲线title('相频曲线-Make by 磊');xlabel('w');ylabel('相位(弧度)');grid on;f=sym('exp(-2*(t-0.6))*heaviside(t-0.6)'); %方程F=fourier(f);%傅里叶变换FT=subs(F,[-2*pi:0.01*pi:2*pi]);%subs()函数来得到傅立叶变换的数值解subplot(3,2,3);%作图区域划分plot([-2*pi:0.01*pi:2*pi],abs(FT));%绘制幅频特性曲线title('幅频曲线-Make by 磊');xlabel('w');ylabel('幅度');subplot(3,2,4);%作图区域划分 plot([-2*pi:0.01*pi:2*pi],angle(FT));%绘制相频特性曲线title('相频曲线-Make by 磊');xlabel('w');ylabel('相位(弧度)');grid on;f=sym('exp(-2*t)*heaviside(t)*exp(i*2*t)');%方程F=fourier(f);%傅里叶变换FT2=subs(F,[-2*pi:0.01*pi:2*pi]);%subs()函数来得到傅立叶变换的数值解subplot(3,2,5);%作图区域划分plot([-2*pi:0.01*pi:2*pi],abs(FT2));%绘制幅频特性曲线grid on;title('幅频曲线-Make by 磊');xlabel('w');ylabel('幅度');subplot(3,2,6);%作图区域划分plot([-2*pi:0.01*pi:2*pi],angle(FT2));%绘制相频特性曲线grid on;title('相频曲线-Make by 磊');xlabel('w');ylabel('相位(弧度)');

运行结果二:

Matlab程序三:

f=sym('sin(2*t)/(2*pi*t)');F=fourier(f);%傅里叶变换FT=subs(F,[-2*pi:0.01*pi:2*pi]);%subs()函数来得到傅立叶变换的数值解subplot(2,2,1);%作图区域划分 plot([-2*pi:0.01*pi:2*pi],abs(FT));%绘制幅频特性曲线title('幅频曲线-Make by 磊');xlabel('w');ylabel('幅度');subplot(2,2,2);%作图区域划分 plot([-2*pi:0.01*pi:2*pi],angle(FT));%绘制相频特性曲线title('相频曲线-Make by 磊');xlabel('w');ylabel('相位(弧度)');grid on;f=sym('(sin(2*t)/(2*pi*t))*cos(6*t)'); %方程F=fourier(f);%傅里叶变换FT=subs(F,[-2*pi:0.01*pi:2*pi]);%subs()函数来得到傅立叶变换的数值解subplot(2,2,3);%作图区域划分plot([-2*pi:0.01*pi:2*pi],abs(FT));%绘制幅频特性曲线title('幅频曲线-Make by 磊');xlabel('w');ylabel('幅度');subplot(2,2,4);%作图区域划分 plot([-2*pi:0.01*pi:2*pi],angle(FT));%绘制相频特性曲线title('相频曲线-Make by 磊');xlabel('w');ylabel('相位(弧度)');grid on;

运行结果三:

Matlab程序四:

f=sym('1/pi*(heaviside(t+0.5*pi)-heaviside(t-0.5*pi))');%方程 F=fourier(f);%傅里叶变换t1=-10*pi:0.01*pi:-0.001;t2=0.001*pi:0.01*pi:10*pi;t=[t1 t2];FT=subs(F,t);%subs()函数来得到傅立叶变换的数值解subplot(3,2,1);%作图区域划分plot(t,abs(FT));%绘制幅频特性曲线title('幅频曲线-Make by 磊');xlabel('w');ylabel('幅度');grid on;subplot(3,2,2);%作图区域划分 plot(t,angle(FT));%绘制相频特性曲线title('相频曲线-Make by 磊');xlabel('w');ylabel('相位(弧度)');grid on;f=sym('1/pi*(heaviside(2*t+0.5*pi)-heaviside(2*t-0.5*pi))');%方程 F=fourier(f);%傅里叶变换t1=-10*pi:0.01*pi:-0.001;t2=0.001*pi:0.01*pi:10*pi;t=[t1 t2];FT=subs(F,t);%subs()函数来得到傅立叶变换的数值解subplot(3,2,3);%作图区域划分 plot(t,abs(FT));%绘制幅频特性曲线title('幅频曲线-Make by 磊');xlabel('w');ylabel('幅度');grid on;subplot(3,2,4);%作图区域划分 plot(t,angle(FT));%绘制相频特性曲线title('相频曲线-Make by 磊');xlabel('w');ylabel('相位(弧度)');grid on; f=sym('1/pi*(heaviside(1/2*t+0.5*pi)-heaviside(1/2*t-0.5*pi))'); F=fourier(f);%傅里叶变换t1=-10*pi:0.01*pi:-0.001;t2=0.001*pi:0.01*pi:10*pi;t=[t1 t2];FT=subs(F,t);%subs()函数来得到傅立叶变换的数值解subplot(3,2,5); %作图区域划分 plot(t,abs(FT));%绘制幅频特性曲线title('幅频曲线-Make by 磊');xlabel('w');ylabel('幅度');grid on;subplot(3,2,6);%作图区域划分 plot(t,angle(FT));%绘制相频特性曲线title('相频曲线-Make by 磊');xlabel('w');ylabel('相位(弧度)');grid on;

运行结果四:

Matlab程序五:

F=sym('1/(w^2+1)');f=ifourier(F);%傅里叶逆变换 ezplot(f); %作图 title('傅里叶逆变换');xlabel('t(sec)');ylabel('y(t)');grid on;

运行结果五:

本人能力有限,解释尚不清楚明了,如遇任何问题,大家可留言或私信。后续将程序文件打包上传,供大家学习使用。

本文希望对大家有帮助,当然上文若有不妥之处,欢迎指正。

分享决定高度,学习拉开差距

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。