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

该实验通过MATLAB对不同非周期信号进行傅里叶变换,分析其频谱特性。实验涉及信号包括指数衰减信号、阶跃函数组合及正弦函数除以频率的信号等。通过对幅频特性和相频特性曲线的绘制,验证了傅里叶变换的性质,展示了信号在频域中的表现。
摘要由CSDN通过智能技术生成

【 实验目的】

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;

运行结果五:

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

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

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

评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

鲁棒最小二乘支持向量机

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值