当前位置:文档之家› 华南理工大学信号与系统大作业

华南理工大学信号与系统大作业

Signal&System Works 五山禅院ID:W ORKORK11系统识别基本题ArrayN=n=x=y=title(title(H=Y./X;%频率响应h=ifft(H);%逆变换subplot(3,1,1);stem(n,h);title('h[n]');subplot(3,1,2);plot(k,abs(H));title('|H(e^j^w)|');subplot(3,1,3)plot(k,angle(H));title('angle of H(e^j^w)');解析法:ωj e −−21∴][)21(][n u n h n =title('|Y(e^j^w)|');xlabel('w');(2)比较卷积输出与理论输出H=Y./X;plot(w,abs(fftshift(H)));title('|H(e^j^w)|');h1=ifft(H);y1=conv(h1,x);subplot(2,1,1);stem(n,y);title('y');subplot(2,1,2);stem([0:length(y1)-1],y1);title('y1');y1=h1*x;发现失真相当严重,原因是x只截取了0:64的值,此时用fft计算出来的为X1(e^jw),与实际的X(e^jw)存在误差。

N=200时,发现误差有了相当大的改善,所以推测正确!(3)频率响应H=Y./X;plot(w,abs(fftshift(H)));title('|H(e^j^w)|');当X很小时,H=Y/X会产生尖峰,因此必须把尖峰平滑掉。

After smooth:简单平滑,只是将尖峰点置零H2=H;for i=1:64if(X(i)<0.01)H2(i)=0;endendplot(w,abs(fftshift(H2)));title('|H2(e^j^w)|');测试输出:h2=ifft(H2);y2=conv(h2,x);subplot(2,1,1);stem(n,y);title('y');y2=y2(1:64);%截取y2的一半subplot(2,1,2);stem([0:length(y2)-1],y2);title('y2');That’’s perfect!I love it. Oh!!That终极smooth:H2(1)=0.5721;Before:简单平滑,只是将尖峰点置零subplot(2,1,1)plot(w,abs(fftshift(H2)));title('|H2(e^j^w)|');subplot(2,1,2)plot(w,angle(fftshift(H2)));title('angle of H2(e^j^w)');After:终极平滑,把尖峰点置成与邻近点相同H2=H;for i=1:64if(X(i)<0.01)for j=i:64%将最近的不等0的wk赋给等于0的w0 if(X(j)>0.01)H2(i)=H(j);endendendendsubplot(2,1,1)plot(w,abs(fftshift(H2)));title('|H2(e^j^w)|');subplot(2,1,2)plot(w,angle(fftshift(H2)));title('angle of H2(e^j^w)');(4)测试平滑后的输出,与理论输出对比h2=ifft(H2);y2=conv(h2,x);subplot(2,1,1);stem(n,y);title('y');y2=y2(1:64);%截取y2的一半subplot(2,1,2);stem([0:length(y2)-1],y2);title('y2');由图可知,效果颇佳!WORK3Hilbert Transform(a)根据频率响应计算得出nn n h ππcos 1][−=所以,h[n]关于原点对称(c)时移(d)n =n1=n2=a =ha =ha =Ha =k =w =title(plot(w,Haangle);α(g)输入:)8sin(n π卷积:)(*)8sin(n h n απ理论输出:]8/)20cos[(π−−n n =0:128;n1=0:19;n2=21:128;a =20;ha =(1-cos(pi*(n1-a)))./pi./(n1-a);ha =[ha,0,(1-cos(pi*(n2-a)))./pi./(n2-a)];x =sin(n*pi/8);subplot(3,1,1);stem(n,x);title('sin(pi*n/8)')xh =conv(x,ha);xh =xh(1:128);%cutsubplot(3,1,2);stem(0:length(xh)-1,xh);title('x[n]*ha[n]')xr =-cos((n-20)*pi/8);subplot(3,1,3);stem(n,xr);title('Theoretical result:-cos((n-20)*pi/8)');(h)输入:卷积:截取20~148,即可得到:)(*)8sin(n h n π理论输出:8cos πn −n =0:128;n1=0:19;n2=21:128;a =20;ha =(1-cos(pi*(n1-a)))./pi./(n1-a);ha =[ha,0,(1-cos(pi*(n2-a)))./pi./(n2-a)];x =sin(n*pi/8);subplot(3,1,1);stem(n,x);title('sin(pi*n/8)')xh =conv(x,ha);xh =xh(21:148);%cut ,截取20-148subplot(3,1,2);stem(0:length(xh)-1,xh);title('x[n]*h[n]')xr =-cos(n*pi/8);%理论输出subplot(3,1,3);stem(n,xr);title('Theoretical result:-cos(n*pi/8)');WORK4SSB-Modulation输入:4/)32()4/)32(sin(][−−=n n n x ππ640≤≤n codeN =64;n =0:N-1;wc =pi/2;x =(sin(pi*(n-32)/4))./(pi*(n-32)/4);x(33)=1;%由洛必达法则得X =fft(x,256);subplot(3,2,1);stem(n,x);title('x');xlabel('n')subplot(3,2,3);w =2*pi*((0:(length(X)-1))-128)/256;%输出移至零频plot(w,abs(fftshift(X)));title('|X|');xlabel('w');x1=x.*cos(wc*n);%x1X1=fft(x1,256);subplot(3,2,2);w =2*pi*((0:(length(X1)-1))-128)/256;%输出移至零频plot(w,abs(fftshift(X1)));title('|X1|');xlabel('w');%hilbert funtiona =20;ha =(1-cos(pi*(n-a)))./pi./(n -a);ha(21)=0;%xh =conv(ha,x);xh =xh(21:84);XH =fft(xh,256);x2=xh.*sin(wc*n);X2=fft(x2,256);w =2*pi*((0:(length(X2)-1))-128)/256;%输出移至零频subplot(3,2,4);plot(w,abs(fftshift(X2)));title('|X2|');xlabel('w');y =x1+x2;Y =fft(y,256);w =2*pi*((0:(length(X2)-1))-128)/256;%输出移至零频subplot(3,2,6);plot(w,abs(fftshift(Y)));title('|Y|');xlabel('w');分析:由上图可看出,][1n x 的频谱是][n x 的频谱向左右搬移2π,同时幅度减小为一半。

类似的,][2n x 的频谱是][n x h 的频谱向左右搬移2π,同时幅度减小为一半。

最后,输出的SSB 信号Y 频谱带宽与原输入信号X 其实是一样的。

在低频段(9.0||≤ω)以及高频段(8.1||≥ω)SSB 的DTFT 基本为零。

Work5SSB-Demodulation解调:)cos(].[n n y c ω2πω=c 低通滤波器:归一化值,1=Axh =xh(21:84);XH =fft(xh,256);x2=xh.*sin(wc*n);%输出调制信号yy =x1+x2;Y =fft(y,256);subplot(3,1,1)w =2*pi*((0:(length(Y)-1))-128)/256;%输出移至零频plot(w,abs(fftshift(Y)));title('|Y|');xlabel('w');%**************************解调**************************** xd=cos(wc*n);%demodulation functionXd=fft(xd,256);w=2*pi*((0:(length(Xd)-1))-128)/256;%输出移至零频subplot(3,1,2);plot(w,abs(fftshift(Xd)));title('|Xd|');xlabel('w');%低通滤波器k=n-32;A=1;%Gainhlp=A*sin(wc*k)./(wc*k);hlp(33)=A;%由洛必达得Hlp=fft(hlp,256);ym=y.*xd;Ym=fft(ym,256);subplot(3,1,3);w=2*pi*((0:(length(Ym)-1))-128)/256;%输出移至零频plot(w,abs(fftshift(Ym)));title('|Ym|');xlabel('w');xr=conv(ym,hlp);%滤波figuresubplot(2,1,1);xr=xr(33:96);%cutstem(n,xr);title('x-recovery')subplot(2,1,2);stem(n,x);%源输入title('x-input')。

相关主题