实验4 非周期信号的傅立叶变换分析
一、 实验目的
(1) 熟悉连续非周期信号频谱特点及其分析方法; (2) 掌握用MATLAB实现傅立叶变换的两种方法; (3) 了解常用傅立叶变换性质的MATLAB实现方法。 二、实验内容与步骤 1、 给定时限信号:
2t1t2,x1(t)1,1t1
t2,1t2编写MATLAB程序Q4_1,用符号运算方法和数值计算两种方法求x1(t)傅里叶
变换。仿真图片包含信号时域波形、幅度谱和相位谱。 程序Q4-1: 数值运算方法:
T = 0.01; dw = 0.1; t = -2:T:2;
w = -4*pi:dw:4*pi;
x1=(ut(t+2)-ut(t+1)).*(t+2)+(ut(t+1)-ut(t-1))+(ut(t-1)-ut(t-2)).*(-t+2); X=x1*exp(-j*t'*w)*T; X1=abs(X); phai=angle(X); subplot(211);
plot(t,x1),grid on, title('信号时域波形'),xlabel('t'),axis([-2.2,2.2,-0.2,1.2]) subplot(223);
plot(X1),grid on, title('频谱图'),axis([50,200,0,4]) subplot(224);
plot(phai),grid on, title('相位图'),axis([10,50,0,4]) 符号运算方法: syms t w x1
x1=sym('(Heaviside(t+2)-Heaviside(t+1))').*(t+2)+sym('Heaviside(t+1)-Heaviside(t-1)')+sym('Heaviside(t-1)-Heaviside(t-2)').*(-t+2); F=fourier(x1)
subplot(3,1,1);ezplot(x1,[-2:2,0.2:1.2]);
subplot(3,1,2);ezplot(abs(F),[-4:4]),grid on, title('频谱图') w=-10:0.01:10; k=-atan2(w,2);
subplot(3,1,3);plot(w,k),grid on, title('相位图')
F =
4/w^2*sin(1/2*w)^2*(2*cos(w)+1)
仿真图形:数值法 符号法
2、编写MATLAB程序Q4_2,求单边指数数信号f(t)2et
的傅立叶变换,
并画出其波形。 程序Q4-2:
syms t w x1
f=2*exp(-t)*sym(' Heaviside (t)')+2*exp(t)*sym(' Heaviside (-t)'); F=fourier(f)
subplot(3,1,1);ezplot(f,[-4:4]);
subplot(3,1,2);ezplot(abs(F),[-10:10]),grid on, title('频谱图') w=-10:0.01:10; k=-atan2(w,2);
subplot(3,1,3);plot(w,k),grid on, title('相位图') 仿真图形:
3、编写MATLAB程序Q4_3,一矩形脉冲f(t)u(t1)u(t1),载波信号
x(t)cos(10t),试用傅立叶变换的数值解法实现调幅信号y(t)f(t)x(t),并
绘制出f(t)、y(t)及它们各自的频谱。
回答问题:结合频谱图,对傅立叶变换的频移特性进行说明。 程序Q4-3:
T = 0.01; dw = 0.1; t = -4:T:4;w = -4:dw:4;
ft=ut(t+1)-ut(t-1);xt=cos(10*pi*t);yt= [ut(t+1)-ut(t-1)].* cos(10*pi*t); X1=ft*exp(-j*t'*w)*T; Y1=yt*exp(-j*t'*w)*T; x=abs(X1);y=abs(Y1); subplot(221);
plot(t,ft), grid on, title(' f(t)=ut(t+1)-ut(t-1)'), xlabel('t'), axis ([-2,2,-2,2]) subplot(223);
plot(t,yt), grid on, title(' y(t)=f(t)*x(t) '), xlabel('t'), axis ([-2,2,-2,2]) subplot(222);
plot(x),grid on, title('x(t)频谱图'), axis ([0,100,-4,4]) subplot(224);
plot(y),grid on, title('y(t)频谱图'), axis ([0,100,-4,4])
仿真图形:
回答问题:结合频谱图,对傅立叶变换的频移特性进行说明。
频移性质表明,若要使一个信号的频谱在频率轴上右移w0单位,在时域就对应于其时间信号x(t)乘以exp(j*w0*t)。
4、编写MATLAB程序Q4_4,设f(t)12e2(t1)u(t1),试用MATLAB绘制出
信号f(t)及其幅度频谱和相位频谱,观察并分析信号时移对信号频谱的影响。 程序Q4-4:
T = 0.01; dw = 0.1; t = -2:T:2; w = -4*pi:dw:4*pi;
x1=(1/2)*exp((-2)*(t-1)).*ut(t-1); X=x1*exp(-j*t'*w)*T; X1=abs(X); phai=angle(X); subplot(211);
plot(t,x1),grid on, title('信号时域波形'),xlabel('t'),axis([1,2,0,0.5]) subplot(223);
plot(X1),grid on, title('频谱图'),axis([0.2,250,0,1]) subplot(224);
plot(phai),grid on, title('相位图'),axis([0.2,250,-4,4])
仿真图形:
分析信号时移对信号频谱的影响:时移性质表明,信号在时间轴上的移位,其频谱函数的幅度谱不变,而相位谱产生附加相移w*t0。 5、求F(j)442的傅里叶逆变换f(t)。
程序Q4-5: syms t w F=4/(4+w^2); f=ifourier(F,w,t) ezplot(f) 仿真图形:
三、实验总结和体会
因篇幅问题不能全部显示,请点此查看更多更全内容