您好,欢迎访问三七文档
当前位置:首页 > IT计算机/网络 > 数据库 > [信息与通信]信号与系统实验报告精品合集
ExperimentExportName:StudentNo:Institute:Dec26,2011ExperimentPurposes1.BefamiliarwiththesoftwareEnvironmentandProgrammingflowinMATLAB5.3.2.Learnhowtodrawthesignalwaveformanddeterminethesignalproperties.3.Calculatetheconvolution,frequencyresponseandsystemoutputbyusingthefunctions:conv,freqz,freqsandfilter.ExperimentContents实验项目一:MATLAB编程基础及典型实例①画出离散时间正弦信号并确定基波周期(注:pi表示圆周率)1x1[n]=sin(pi*4/4)*cos(pi*n/4)2x2[n]=cos(pi*n/4)*cos(pi*n/4)3x3[n]=sin(pi*n/4)*cos(pi*n/8)programformatlabn=0:31;x1=sin(pi*n/4).*cos(pi*n/4);x2=cos(pi*n/4).*cos(pi*n/4);x3=sin(pi*n/4).*cos(pi*n/8);subplot(3,1,1);stem(n,x1);title('x1');subplot(3,1,2);stem(n,x2);title('x2');subplot(3,1,3);stem(n,x3);title('x3');gridon;Conclusion:Thesesignalsisperiodic,thefirstandsecondsignal’speriodare4.Thethirdsignal’speriodis16.②离散时间系统性质:离散时间系统往往是用几个性质来表征,如线性、时不变性、稳定性、因果性及可逆性等。MATLAB可用来构成一些反例证明某些性质不满足。(a)系统y[n]=sin((pi/2)x[n])不是线性的。利用信号x1[n]=δ[n]和x2=2δ[n]来证明该系统不满足线性性质。(b)系统y[n]=x[n]+x[n+1]不是因果的。利用信号x[n]=u[n]证明它。定义向量x和y分别代表在-5=n=9上的输入和在-6=n=9上的输出。Programformatlab1.4(a)n=[0:20];x1=[1zeros(1,20)];x2=2*x1;x=x1+x2;y1=sin((pi/2)*x1);y2=sin((pi/2)*x2);y=sin((pi/2)*x);figure(1),stem(n,y1)figure(2),stem(n,y2)figure(3),stem(n,y)1.4(b)x1=[zeros(1,5)ones(1,10)];x2=[zeros(1,4)ones(1,11)];y=x1+x2;n1=[-5:9];n2=[-5:9];figure(1),stem(n1,x1)figure(2),stem(n2,y)Conclusion:y[n]=sin((pi/2)x[n])isnotlinearandy[n]=x[n]+x[n+1]isnotcuasalandtheresultisshowninthechartabove.○3卷积计算:有限长信和(1)用解析方法计算y[n]=x[n]*h[n](2)用conv计算y。步骤:a.定义0≤n≤5区间上的向量xb.定义0≤n≤5区间上的向量hc.用y=conv(x,h)计算yd.构造y的标号向量nye.用stem(ny,y)画出结果f.验证此结果与解析导出的结果是否一致?ProgramformatlabN=6;M=6;L=N+M-1;x=[1,1,1,1,1,1];h=[0,1,2,3,4,5];y=conv(x,h);nx=0:N-1;nh=0:M-1;ny=0:L-1;stem(ny,y);xlabel('n');xlabel('y');Conclusion:y=ans=3andtheresultisshowinthepictureabove.实验项目2一、实验项目名称:周期信号傅里叶分析及其MATLAB实现二、上机实验题目:特征函数在LTI系统傅里叶分析中的应用1.实验项目的目的和任务:掌握特征函数在系统响应分析中的作用,正确理解滤波的概念。2.上机实验内容:1函数Filter、Freqz和Freqs的使用:2.2节(g)、3.2节、4.1节2计算离散时间傅里叶级数:3.1节3LTI系统的特征函数:3.4节(a),(b),(c)4用离散时间傅里叶级数综合信号:3.5节(d),(e),(f),(h).5吉布斯现象:根据英文教材Example3.5验证Fig3.9的吉布斯现象(a)~(d).1函数Filter、Freqz和Freqs的使用:2.2节(g)、3.2节、4.1节filter:计算由线性常系数差分方程表征的因果LTI系统的输出若x是在nx≤n≤nx+Nx-1上的输入向量,而向量a和b包含系数ak和bm,那么y=filter(b,a,x)就得到在nx≤n≤nx+Nx-1上的系统输出y[n]+2y[n-1]=x[n]-3x[n-1]则a=[12],b=[1–3]%2.2gMainProgramx=[1,1,1,1,1,1,0,0,0,0,0];h=[0,1,2,3,4,5];y=filter(h,1,x);ny=[0:10];stem(ny,y);xlabel('n');xlabel('y');%3.2a1=[1-0.80];b1=[20-1];N=4;[h1omega1]=freqz(b1,a1,N)[h2omega2]=freqz(b1,a1,N,'whole')%4.1a=[13];b=3;figure;freqs(b,a);w=linspace(0,3*pi);h=freqs(b,a,w);figure;plot(w,abs(h));a1=[341];b1=[105];figure;freqs(b1,a1);②计算离散时间傅里叶级数:3.1节x=[11zeros(1,30)];a=(1/32)*fft(x)n=[0:31];figure(1),stem(n,a)figure(2),stem(n,imag(a))y=32*ifft(a);figure(3),stem(n,y)figure(4),stem(n,imag(y))③LTI系统的特征函数:3.4节(a),(b),(c)%3.4(a)n=-20:100;x1=exp(j*(pi/4)*n);x2=sin(pi*n/8+pi/16);x3=(9/10).^n;x4=n+1;subplot(5,1,1),stem(n,real(x1));title('real(x1)');axis([0,100,-5,5])subplot(5,1,2),stem(n,imag(x1));title('imag(x1)');axis([0,100,-5,5])subplot(5,1,3),stem(n,x2);title('x2');axis([0,100,-5,5])subplot(5,1,4),stem(n,x3);title('x3')subplot(5,1,5),stem(n,x4);title('x4')%3.4(b)n=0:100;x1=exp(j*(pi/4)*n);x2=sin(pi*n/8+pi/16);x3=(9/10).^n;x4=n+1;a=[1-0.25];b=[10.9];y1=filter(b,a,x1);y2=filter(b,a,x2);y3=filter(b,a,x3);y4=filter(b,a,x4);figure;subplot(5,1,1),stem(n,real(y1));title('real(y1)')subplot(5,1,2),stem(n,imag(y1));title('imag(y1)')subplot(5,1,3),stem(n,y2);title('y2')subplot(5,1,4),stem(n,y3);title('y3')subplot(5,1,5),stem(n,y4);title('y4')%3.4(c)h1=y1./x1;h2=y2./x2;h3=y3./x3;h4=y4./x4;figure;subplot(5,1,1),stem(n,real(h1));title('real(h1)')subplot(5,1,2),stem(n,imag(h1));title('imag(h1)')subplot(5,1,3),stem(n,h2);title('h2')subplot(5,1,4),stem(n,h3);title('h3')subplot(5,1,5),stem(n,h4);title('h4')%3.5(d)functionx=period(xn)x=zeros(1,64);[a,b]=size(xn);fork=1:(64/b)x(1,b*(k-1)+1:b*k)=xn;endx1=ones(1,8);x2=[x1,zeros(1,8)]x3=[x1,zeros(1,24)];x11=period(x1);x22=period(x2);x33=period(x3);n=[0:63];subplot(3,1,1);stem(n,x11)subplot(3,1,2);stem(n,x22)subplot(3,1,3);stem(n,x33)x2=Columns1through131111111100000Columns14through16000%3.5(e)x11=[ones(1,8)ones(1,8)ones(1,8)ones(1,8)ones(1,8)ones(1,8)ones(1,8)ones(1,8)];x22=[ones(1,8)zeros(1,8)ones(1,8)zeros(1,8)ones(1,8)zeros(1,8)ones(1,8)zeros(1,8)];x33=[ones(1,8)zeros(1,24)ones(1,8)zeros(1,24)];a1=(1/64)*fft(x11);a2=(1/64)*fft(x22);a3=(1/64)*fft(x33);n=[0:63];subplot(3,1,1);figure(1),stem(n,a1)subplot(3,1,2);figure(2),stem(n,a2)subplot(3,1,3);figure(3),stem(n,a3)figure(4),stem(n,imag(a1))figure(5),stem(n,imag(a2))figure(6),stem(n,imag(a3))%3.5(f)functionx=func(ak,n)x=0;fork=-31:31ifk=0ak(k)=ak(-k)x=x+ak(k)*exp(i*k*(2*pi/32)*n);elsex=x+ak(k)*exp(i*k*(2*pi/32)*n);endendsubplot(3,1,1);n=[0:31];x3_2=zeros(1,32);fork=1:32x3_2(k)=real(func(a3,k));endstem(n,x3_2)%3.5(h)functionx=dtfs(ak,n)x=0;fork=-31:31ifk=0ak(k)=ak(-k)x=x+ak(k)*exp(i*k*(2*pi/32)*n);elsex=x+ak(k)*exp(i*k*(2*pi/32)*n);endend⑤吉布斯现象:根据英文教材Example3.5验证Fig3.9的吉布斯现象(a)~(d)%Gibbsx=1/2;k=0;t=-2:0.01:2;x1=[-2-1-1112];y1=[001100];fori=
本文标题:[信息与通信]信号与系统实验报告精品合集
链接地址:https://www.777doc.com/doc-4717156 .html