周期信号的频谱分析.doc

上传人:大张伟 文档编号:7208473 上传时间:2020-11-06 格式:DOC 页数:12 大小:183KB
返回 下载 相关 举报
周期信号的频谱分析.doc_第1页
第1页 / 共12页
周期信号的频谱分析.doc_第2页
第2页 / 共12页
周期信号的频谱分析.doc_第3页
第3页 / 共12页
周期信号的频谱分析.doc_第4页
第4页 / 共12页
周期信号的频谱分析.doc_第5页
第5页 / 共12页
点击查看更多>>
资源描述

《周期信号的频谱分析.doc》由会员分享,可在线阅读,更多相关《周期信号的频谱分析.doc(12页珍藏版)》请在三一文库上搜索。

1、信号与系统实验报告实验三 周期信号的频谱分析实验报告评分:_实验三 周期信号的频谱分析实验目的:1、掌握连续时间周期信号的傅里叶级数的物理意义和分析方法;2、观察截短傅里叶级数而产生的“Gibbs现象”,了解其特点以及产生的原因;3、掌握各种典型的连续时间非周期信号的频谱特征。实验内容:(1)Q3-1编写程序Q3_1,绘制下面的信号的波形图:其中,0=0.5,要求将一个图形窗口分割成四个子图,分别绘制cos(w0t)、cos(3w0t)、cos(5w0t)和x(t)的波形图,给图形加title,网格线和x坐标标签,并且程序能够接受从键盘输入的和式中的项数。程序如下:clear,%Clear a

2、ll variables close all,%Close all figure windows dt = 0.00001; %Specify the step of time variable t = -2:dt:4; %Specify the interval of time w0=0.5*pi; x1=cos(w0.*t); x2=cos(3*w0.*t); x3=cos(5*w0.*t); N=input(Type in the number of the harmonic components N=); x=0; for q=1:N; x=x+(sin(q*(pi/2).*cos(q

3、*w0*t)/q; end subplot(221) plot(t,x1)%Plot x1 axis(-2 4 -2 2); grid on, title(signal cos(w0.*t) subplot(222) plot(t,x2)%Plot x2 axis(-2 4 -2 2); grid on, title(signal cos(3*w0.*t) subplot(223) plot(t,x3)%Plot x3 axis(-2 4 -2 2) grid on, title(signal cos(5*w0.*t)subplot(224) plot(t,x)%Plot xt axis(-2

4、 4 -2 2) grid on, title(signal xt)(2)给程序3_1增加适当的语句,并以Q3_2存盘,使之能够计算例题1中的周期方波信号的傅里叶级数的系数,并绘制出信号的幅度谱和相位谱的谱线图。程序如下:% Program3_1 clear, close all T = 2; dt = 0.00001; t = -2:dt:2; x1 = ut(t) - ut(t-1-dt); x = 0; for m = -1:1 x = x + ut(t-m*T) - ut(t-1-m*T-dt); end w0 = 2*pi/T; N = 10; L = 2*N+1; for k =

5、-N: N; ak(N+1+k) = (1/T)*x1*exp(-j*k*w0*t)*dt; end phi = angle(ak); subplot(211) k = -10:10; stem (k,abs(ak),k); axis(-10,10,0,0.6); grid on; title(fudupu); subplot(212); k = -10:10 stem(k,angle(ak),k); axis(-10,10,-2,2); grid on; titie(xiangweipu);xlabel(Frequency index x); (3)反复执行程序Program3_2,每次执行

6、该程序时,输入不同的N值,并观察所合成的周期方波信号。通过观察,你了解的吉伯斯现象的特点是:程序如下:clear,close all T = 2; dt = 0.00001; t = -2:dt:2; x1 = ut(t)-ut(t-1-dt); x = 0; for m = -1:1 x = x + ut(t-m*T) - ut(t-1-m*T-dt); end w0 = 2*pi/T; N = input(Type in the number of the harmonic components N = :); L = 2*N+1; for k = -N:1:N; ak(N+1+k) =

7、(1/T)*x1*exp(-j*k*w0*t)*dt; end phi = angle(ak); y=0; for q = 1:L; y = y+ak(q)*exp(j*(-(L-1)/2+q-1)*2*pi*t/T); end; subplot(221), plot(t,x), title(The original signal x(t), axis(-2,2,-0.2,1.2), subplot(223), plot(t,y), title(The synthesis signal y(t), axis(-2,2,-0.2,1.2), xlabel(Time t), subplot(222

8、) k=-N:N; stem(k,abs(ak),k.), title(The amplitude |ak| of x(t), axis(-N,N,-0.1,0.6) subplot(224) stem(k,phi,r.), title(The phase phi(k) of x(t), axis(-N,N,-2,2), xlabel(Index k) N=1N=3通过观察我们了解到:如果一个周期信号在一个周期有内断点存在,那么,引入的误差将除了产生纹波之外,还将在断点处产生幅度大约为9%的过冲(Overshot),这种现象被称为吉伯斯现象(Gibbsphenomenon)。即信号在不连续点附

9、近存在一个幅度大约为9%的过冲,且所选谐波次数越多,过冲点越向不连续点靠近。(4)计算如图的傅里叶级数的系数程序如下:clc,clear,closeallT=2;dt=0.00001;t=-3:dt:3;x=(t+1).*(u(t+1)-u(t)-(t-1).*(u(t)-u(t-1);x1=0;form=-2:2x1=x1+(t+1-m*T).*(u(t+1-m*T)-u(t-m*T)-(t-1-m*T).*(u(t-m*T)-u(t-1-m*T);endw0=2*pi/T;N=10;L=2*N+1;fork=-N:N;ak(N+1+k)=(1/T)*x*exp(-j*k*w0*t)*dt;

10、endphi=angle(ak);plot(t,x1);axis(-4401.2);gridon;title(Thesignalx1(t);xlabel(Timet(sec);ylabel(signalx1(t);(5)仿照程序3_1,编写程序Q3_5,以计算x2(t)的傅里叶级数的系数(不绘图)。程序如下:clc,clear,close all T=2;dt=0.00001;t=-3:dt:3; x=ut(t+0.2)-ut(t-0.2-dt);x2=0; for m=-1:1 x2=x2+ut(t+0.2-m*T)-ut(t-0.2-m*T)-ut(t-0.2-m*t-dt); end w

11、0=2*pi/T; N=10; L=2*N+1for k=-N:N; ak(N+1+k)=(1/T)*x*exp(-j*k*w0*t)*dt; end phi=angle(ak); plot(t,x2); axis(-2.5 2.5 0 1.2); grid on; title(The signal x2(t); xlabel(Time t (sec); ylabel(signal x2(t);(6)仿照程序3_2,编写程序Q3_6,计算并绘制出原始信号x1(t)的波形图,用有限项级数合成的y1(t)的波形图,以及x1(t)的幅度频谱和相位频谱的谱线图。 程序如下:clc,clear,clos

12、e all T=2;dt=0.00001;t=-3:dt:3; x=(t+1).*(ut(t+1)-ut(t)-(t-1).*(ut(t)-ut(t-1);x1=0; for m=-2:2 x1=x1+(t+1-m*T).*(ut(t+1-m*T)-ut(t-m*T)-(t-1-m*T).*(ut(t-m*t)-ut(t-1-m*t); end w0=2*pi/T; N=10; L=2*N+1; for k=-N:N; ak(N+1+k)=(1/T)*x*exp(-j*k*w0*t)*dt;end phi=angle(ak); y=0; for q=1:L; y=y+ak(q)*exp(j*(

13、q-1-N)*w0*t); end; subplot(221) plot(t,x)%plot x axis(-3 3 -0.2 1.2); grid on; title(The original signal x(t); subplot(223) plot(t,y)%Plot y axis(-3 3 -0.2 1.2); grid on; title(The synthesis signal y(t); subplot(222); xlabel(Time i (sec); subplot(222);k=-N:N; stem(k,abs(ak),k); axis(-N N -0.1 0.6);

14、grid on; title(The amplitude spectrum of x(t); subplot(224); k=-N:N; stem(k,phi,k); axis(-N N -2 2); grid on; title(The phase spectrum of x(t); xlabel(Frequency index k); 实验心得:在实验的过程中,掌握连续时间周期信号的傅里叶级数的物理意义和分析方法,观察截短傅里叶级数而产生的“Gibbs现象”,了解其特点以及产生的原因,掌握各种典型的连续时间非周期信号的频谱特征。发现自己在上课时候完全是一窍不通,可能是因为自己练的不够。通过网上和书本查找资料,了解实验的过程。经过两次MATLAB的学习,已经较熟练的应用软件,但中间还有很多需要我们去学习的。在这次实验中我体会到:实验就是一个发现错误并改正错误的过程。正因为有错误的出现才显示出实验的魅力。

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 科普知识


经营许可证编号:宁ICP备18001539号-1