实验三周期信号的频谱分析报告实验报告材料.doc

上传人:李司机 文档编号:1119499 上传时间:2022-06-27 格式:DOC 页数:20 大小:130.74KB
返回 下载 相关 举报
实验三周期信号的频谱分析报告实验报告材料.doc_第1页
第1页 / 共20页
实验三周期信号的频谱分析报告实验报告材料.doc_第2页
第2页 / 共20页
实验三周期信号的频谱分析报告实验报告材料.doc_第3页
第3页 / 共20页
实验三周期信号的频谱分析报告实验报告材料.doc_第4页
第4页 / 共20页
实验三周期信号的频谱分析报告实验报告材料.doc_第5页
第5页 / 共20页
点击查看更多>>
资源描述

《实验三周期信号的频谱分析报告实验报告材料.doc》由会员分享,可在线阅读,更多相关《实验三周期信号的频谱分析报告实验报告材料.doc(20页珍藏版)》请在三一办公上搜索。

1、word信号与系统实验报告实验三 周期信号的频谱分析一、实验目的1、掌握连续时间周期信号的傅里叶级数的物理意义和分析方法;2、观察截短傅里叶级数而产生的“Gibbs现象,了解其特点以与产生的原因;3、掌握各种典型的连续时间非周期信号的频谱特征。二、实验容实验前,必须首先阅读本实验原理,读懂所给出的全部例程序。实验开始时,先在计算机上运行这些例程序,观察所得到的信号的波形图。并结合例程序应该完成的工作,进一步分析程序中各个语句的作用,从而真正理解这些程序。实验前,一定要针对下面的实验项目做好相应的实验准备工作,包括事先编写好相应的实验程序等事项。Q3-1 编写程序Q3_1,绘制下面的信号的波形图

2、:其中,w0,要求将一个图形窗口分割成四个子图,分别绘制cos(w0t)、cos(3w0t)、cos(5w0t) 和x(t) 的波形图,给图形加title,网格线和x坐标标签,并且程序能够承受从键盘输入的和式中的项数。抄写程序Q3_1如下:clear,%Clear all variablesclose all,%Close all figure windowsdt = 0.00001; %Specify the step of time variablet = -2:dt:4; %Specify the interval of timew0=0.5*pi;x1=cos(w0.*t);x2=co

3、s(3*w0.*t);x3=cos(5*w0.*t);N=input(Type in the number of the harmonic ponents N=);x=0;for q=1:N; x=x+(sin(q*(pi/2).*cos(q*w0*t)/q;endsubplot(221)plot(t,x1)%Plot x1axis(-2 4 -2 2);grid on,title(signal cos(w0.*t)subplot(222)plot(t,x2)%Plot x2axis(-2 4 -2 2);grid on,title(signal cos(3*w0.*t)subplot(223

4、)plot(t,x3)%Plot x3axis(-2 4 -2 2)grid on,title(signal cos(5*w0.*t)执行程序Q3_1所得到的图形如下:Q3-2 给程序Program3_1增加适当的语句,并以Q3_2存盘,使之能够计算例题1中的周期方波信号的傅里叶级数的系数,并绘制出信号的幅度谱和相位谱的谱线图。通过增加适当的语句修改Program3_1而成的程序Q3_2抄写如下:% Program3_1clear, close allT = 2; dt = 0.00001; t = -2:dt:2;x1 = u(t) - u(t-1-dt); x = 0;for m = -1

5、:1 % Periodically extend x1(t) to form a periodic signalx = x + u(t-m*T) - u(t-1-m*T-dt);endw0 = 2*pi/T;N = 10; % The number of the harmonic ponentsL = 2*N+1;for k = -N: N; % Evaluate the Fourier series coefficients akak(N+1+k) = (1/T)*x1*exp(-j*k*w0*t)*dt;endphi = angle(ak); % Evaluate the phase of

6、 aksubplot(211)k = -10:10;stem (k,abs(ak),k);axis(-10,10,0,0.6);grid on;title(fudupu);subplot(212);k = -10:10stem(k,angle(ak),k);axis(-10,10,-2,2);grid on;titie(xiangweipu);xlabel(Frequency index x);执行程序Q3_2得到的图形Q3-3 反复执行程序Program3_2,每次执行该程序时,输入不同的N值,并观察所合成的周期方波信号。通过观察,你了解的吉伯斯现象的特点是:% Program3_3% Th

7、is program is used to pute the Fourier series coefficients ak of a periodic square waveclear,close allT = 2; dt = 0.00001; t = -2:dt:2;x1 = u(t)-u(t-1-dt); x = 0;for m = -1:1x = x + u(t-m*T) - u(t-1-m*T-dt); % Periodically extend x1(t) to form a periodic signalendw0 = 2*pi/T;N = input(Type in the nu

8、mber of the harmonic ponents N = :);L = 2*N+1;for k = -N:1:N;ak(N+1+k) = (1/T)*x1*exp(-j*k*w0*t)*dt;endphi = angle(ak);y=0;for q = 1:L; % Synthesiz the periodic signal y(t) from the finite Fourier seriesy = y+ak(q)*exp(j*(-(L-1)/2+q-1)*2*pi*t/T);end;subplot(221),plot(t,x), title(The original signal

9、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)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(Ind

10、ex k)N=1N=2通过观察我们了解到:如果一个周期信号在一个周期有断点存在,那么,引入的误差将除了产生纹波之外,还将在断点处产生幅度大约为9%的过冲Overshot,这种现象被称为吉伯斯现象Gibbs phenomenon。即信号在不连续点附近存在一个幅度大约为9%的过冲,且所选谐波次数越多,过冲点越向不连续点靠近。4、周期信号的傅里叶级数与GIBBS现象给定如下两个周期信号:Q3-4仿照程序Program3_1,编写程序Q3_4,以计算x1(t)的傅里叶级数的系数。程序Q3_4如下:clc,clear,close allT=2;dt=0.00001;t=-3:dt:3;x=(t+1).*

11、(u(t+1)-u(t)-(t-1).*(u(t)-u(t-1);x1=0;for m=-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;for k=-N:N;ak(N+1+k)=(1/T)*x*exp(-j*k*w0*t)*dt;endphi=angle(ak);plot(t,x1);axis(-4 4 0 1.2);grid on;title(The signal x1(t);xlabel(Time t (sec);ylabel(signal

12、 x1(t);执行程序Q3_4所得到的x1(t)的傅里叶级数的ak从-10到10共21个系数如下:Q3-5仿照程序Program3_1,编写程序Q3_5,以计算x2(t) 的傅里叶级数的系数不绘图。程序Q3_5如下:clc,clear,close allT=2;dt=0.00001;t=-3:dt:3;x=u(t+0.2)-u(t-0.2-dt);x2=0;for m=-1:1x2=x2+u(t+0.2-m*T)-u(t-0.2-m*T)-u(t-0.2-m*t-dt);endw0=2*pi/T;N=10;L=2*N+1;for k=-N:N;ak(N+1+k)=(1/T)*x*exp(-j*

13、k*w0*t)*dt;endphi=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);执行程序Q3_5所得到的x2(t)的傅里叶级数的ak从-10到10共21个系数如下:与你手工计算的ak相比拟,是否一样,如有不同,是何原因造成的?Q3-6仿照程序Program3_2,编写程序Q3_6,计算并绘制出原始信号x1(t) 的波形图,用有限项级数合成的y1(t) 的波形图,以与x1(t) 的幅度频谱和相位频谱的谱线图。编写程序

14、Q3_6如下:%Program Q3_6%This program is used to evaluate the Fourier serier coefficients ak of a periodic squareclc,clear,close allT=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;for m=-2:2 %Periodically extend x1(t) to form q periodic signalx1=x1+(t+1-m*T).*(u(t+1-m*T)-u(t-m*T)

15、-(t-1-m*T).*(u(t-m*t)-u(t-1-m*t);endw0=2*pi/T;N=10; %the number of the harmonic ponentsL=2*N+1;for k=-N:N;ak(N+1+k)=(1/T)*x*exp(-j*k*w0*t)*dt;endphi=angle(ak); %Evaluate the phase of sky=0;for q=1:L; %Synthesiz the periodic signal y(t) from the finite Fourier seriesy=y+ak(q)*exp(j*(q-1-N)*w0*t);end;

16、subplot(221)plot(t,x)%plot xaxis(-3 3 -0.2 1.2);grid on;title(The original signal x(t);subplot(223)plot(t,y)%Plot yaxis(-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);grid on;title(The amplitude spectr

17、um 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);执行程序Q3_6,输入N = 10所得到的图形如下:反复执行程序Q3_6,输入不同的N值,观察合成的信号波形中,是否会产生Gibbs现象?为什么?假定输入N=10,得到图形如下:所以不会产生Gibbs现象,即与N值无关。给定两个时限信号:实验体会与心得:在实验的过程中,掌握连续时间周期信号的傅里叶级数的物理意义和分析方法,观察截短傅里叶级数而产生的“Gibbs现象,了解其特点以与产生的原因,掌握各种典型的连续时间非周期信号的频谱特征。发现自己在上课时候完全是一窍不通,可能是因为自己练的不够所以在下来的学习中,我认为实练永远是自己要去做得功课,即使自己现在还不会,但我坚信孰能生巧,自己一定能够学好这门科目。20 / 20

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

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号