实验四 离散时间系统的频域分析
(1) 复习傅里叶变换的定义及其性质,加深理解。(2) 熟悉离散时间傅里叶变换的概念及其性质。参考-计算离散时间傅里叶变换,并绘制图形。已知有限长序列x(n)二1,2,3,4,5。n=T:3;x=1:5;k=0:500;w=(pi/500)*k;X=x*(exp(-j*2*pi/500).八(n'*k); magX二abs(X);angX二angle(X);realX二real(X);imagX二imag(X);subpl ot( 2,2,1);pl ot( w/pi,magX);grid; xlabel('');ylabel('模值');title('模值部分');subpl ot( 2,2,2);pl ot( w/pi,angX);grid; xlabel('pi 为单位');ylabel('弧度');title('相角部分');subpl ot( 2,2,3);pl ot( w/pi,realX);grid; xlabel('');ylabel('实部');title('实部部分');subpl ot( 2,2,4);pl ot( w/pi,imagX);grid; xlabel('pi 为单位');ylabel('虚部');title('虚部部分');相角部廿2 + eiw1 + 0.6幺一iw参考二:计算离散时间傅里叶变换。% Evaluation of the DTFT H(幺-iw)=elf;% Compute the frequency samples of the DTFTw = -4*pi:8*pi/511:4*pi;num = 2 1;den = 1 -0.6;h = freqz(num, den, w);% Plot the DTFTsubplot(2,l,l);plot(w/pi,real(h);gridtitle('Real part of H(eAjomega)') xlabel('omega 八pi');ylabel('Amplitude');subplot(2,1,2);plot(w/pi,imag(h);gridtitle('Imaginary part of H(eAjomega)') xlabel('omega 八pi');ylabel('Amplitude');pausesubplot(2,1,1);plot(w/pi,abs(h);gridtitle( Magnitude Spectrum IH(ejomega)l) xlabel('omega 八pi');ylabel('Amplitude');subplot(2,l,2);plot(w/pi,angle(h);gridtitle('Phase Spectrum argH(eAJomega)') xlabel('omega 八pi');ylabel('Phase in radians');Real part ofCD三 s_2-4-31234-4Magnitude Spectrum |H(e100)!34-2 -1 0 1 2Phase SpecVriin 曰rgHej日 曰42 启三一-dlllv-3SU 昙E2u£sf23-2 -10 1oa /-n(3) 熟悉离散傅里叶变换的概念及其性质参考一:x(n)二sin(n*pi/8)+sin(n*pi/4)是一个N=16的序列,计算其傅里叶变换。N=16;n=0:N-1;xn=sin(n*pi/8)+sin(n*pi/4);k=0:1:N-1;WN=exp(-j*2*pi/N);nk=n'*k;WNnk=WN.Ank;Xk=xn*WNnk;subplot(2,1,1);stem(n,xn);subplot(2,1,2);stem(k,abs(Xk);参考二:计算 x(n)=8*(0.4)4n,n 属于0,20)的圆周移位x (n) = x(n +10) R (n)。m2020N=20;m=10;n=0:1:N-1;x=8*(0.4)4n; n1=mod(n+m),N);xm=x(n1+1);subplot(2,1,1);stem(n,x); title('original sequence');xlabel('n');ylabel('x(n)'); subplot(2,1,2);stem(n,xm);title('circular shift equence');xlabel('n');ylabel('x(n+10)mod 20');匚i rcula r =Hift QiquDnc q5.思考题(1) 理解离散时间系统的频域分析,掌握和加深对傅立叶变换及其性质的理解。(2) 计算一个N=12的序列x(n)二cos(n*pi/6)的离散时间傅里叶变换。程序:N=12;n=0:NT;xn二cos(n*pi/6);k=0:1:NT;WN=exp(-j*2*pi/N);nk=n'*k;WNnk=WN.nk;Xk=xn*WNnk;subpl ot( 2,1,1);s tem(n,xn);grid;subpl ot( 2,1,2);s tem(k,abs(Xk);grid;(3) 求 xl(n) = (0.8)."n,其中 n 属于0,10与 x2(n) = (0.6)."n,并且 n 属于0,18的圆 周卷积(N=20)。先构造一个计算圆周卷积的函数进行计算。程序:先建立一个位移函数保存为wy.mfunc tion a=wy(x,m,N)n=0:1:N1;a=x(mod(n-m,N)+1); 圆周卷积主程序:n1=0:10;n2=0:18;x1=(0.8)."n1;x2=(0.6)."n2;>> x1二x1,zeros(1,NTeng th(x1);>> x2二x2,zeros(1,NTeng th(x2);>> n=0:1:N-1;>> N=20;>> H=zeros(N,N);>> for n=1:1:N;H(n,:)=wy (x2,n-1,N);end>> y=x1*H'n=0:NT;stem(n,y);grid; title('圆周卷积');xlabel('n');ylabel('y(n)');2i.e1.61.41.2長10.8 .G .4 .2