首页 > 编程知识 正文

常用信号傅里叶变换,matlab傅立叶变换工具

时间:2023-05-06 01:12:28 阅读:169964 作者:2860

【实验目的】基于MATLAB的非周期信号频谱分析

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

【实验内容】

【实验报告要求】(1)记录实验1和实验3的波形;

)2)总结实验2中光谱特性曲线的变化特征;

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

Matlab程序1:f=sym('exp(-2*t ) *heaviside(t ) 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 ('相位)弧度); 网格开; 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 ('相位)弧度); 网格开; f=sym (头部iside (T2 ) -头部iside (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 (宽度); 网格开; subplot (4,2,6 ); %绘图区域分割plot(t,Angle ) ft ); %相位频率特性曲线title (相位频率曲线-Make by磊); xlabel(w ); ylabel ('相位)弧度); 网格开; 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 ('相位)弧度); 网格开; 执行结果1 :

Matlab程序2:f=sym('exp(-2*t ) *heaviside(t ) 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 ('相位)弧度); 网格开; 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; 运行结果五:


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

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

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

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。