文档详情

数字信号处理实验报告答案..docx

发布:2017-01-10约字共12页下载文档
文本预览下载声明
数字信号处理实验一A均匀A=rand(1,500);stem(A,*);legend(均匀分布);title(习题a);正态R=normrnd(0,1,1,500);stem(R,filled);title(习题a);BN=50;Nx=10;n=0:N-1;h=(0.9).^n;R=sign(sign(Nx-1-n)+1);w=conv(h,R);stem(w);title(求h(n)与Rn的卷积);c.N=20;b=[1,-1,0.9];a=[1,0,0];h1=[1 zeros(1,N-1)];h2=ones(1,N);n=0:N-1;y1=filter(a,b,h1);%单位冲激响应y2=filter(a,b,h2);%单位阶跃响应subplot(1,2,1);stem(n,y1);legend(单位冲激响应);subplot(1,2,2);stem(n,y2);legend(单位阶跃响应);------------------------------------------------------------------------------b=[1,-1,0.9];a=[1,0,0];zplane(b,a);legend(h(n)的零、极点分布图);由零极点分布图可以看出,在单位圆内有极点,所以系统不稳定。D.clc;n=-20:20;x=(0.8).^n;k=-200:200;w=(pi/100)*k;X=x*(exp(-j*pi/100)).^(n*k);magx=abs(X);angx=angle(X);im=imag(X);re=real(X);subplot(2,2,1)plot(w,magx);title(幅值);subplot(2,2,2)plot(w,angx);title(相位);subplot(2,2,3);plot(w,im);title(虚部);subplot(2,2,4);plot(w,re);title(实部);E.(稳态响应不会求)clc;b=[1,-0.7];a=[1,0];[H,w]=freqz(b,a,100);magH=abs(H);phaH=angle(H);subplot(2,1,1);plot(w,magH);title(频率响应的幅值);subplot(2,1,2);plot(w,phaH);title(频率响应的相位);F.clc;Dt=0.00005;t=-0.005:Dt:0.005;xa=exp(-1000*abs(t));Wmax=2*pi*2000;K=500;k=0:1:K;W=k*Wmax/K;Xa=xa*exp(-j*t*W)*Dt;Xa=real(Xa);W=[-fliplr(W),W(2:501)];Xa=[fliplr(Xa),Xa(2:501)];subplot(4,2,1);plot(t*1000,xa);ylabel(xa(t));grid on;subplot(4,2,2);plot(W/(2*pi*1000),Xa*1000);ylabel(Xa(w));grid on;Ts1=0.0002;n1=-25:1:25;x1=exp(-1000*abs(n1*Ts1));Ts2=0.001;n2=-5:1:5;x2=exp(-1000*abs(n2*Ts2));N=500;k=0:1:N;w=pi*k/N;X1=x1*exp(-j*n1*w);X1=real(X1);X2=x2*exp(-j*n2*w);X2=real(X2);w=[-fliplr(w),w(2:N+1)];X1=[fliplr(X1),X1(2:N+1)];X2=[fliplr(X2),X2(2:N+1)];subplot(4,2,3);stem(n1*Ts1*1000,x1);ylabel(x1(n));legend(抽样频率f1=);grid on;subplot(4,2,4);plot(w/pi,X1);ylabel(X1(w));grid on;subplot(4,2,5);stem(n2*Ts2*1000,x2);ylabel(x2(n));legend(抽样频率f2=);subplot(4,2,6);plot(w/pi,X2);ylabel(X2(w));Fs1=1/Ts1;nTs1=n1*Ts1;xa1=x1*sinc(Fs1*(ones(length(n1),1)*t-nTs1*ones(1,length(t))));subplot(4,2,7);plot(t*1000,xa1);ylabel(xa1(t));grid on;error1=max(abs(xa1-xa))Fs2=1/Ts2;nTs2=n2*Ts2;xa2=x2*sinc(Fs2*(ones
显示全部
相似文档