資源描述:
《數(shù)字信號處理作業(yè)》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。
1、一、沖激信號1.x1[n]=0.9δ[n-5]代碼:>>L=21;>>nn=0:(L-1);>>imp=zeros(L,1);>>imp(6)=1;>>stem(nn,imp())>>ylabel('x1[n]=0.9δ[n-5]')>>grid>>gtext('t')圖形:2.x2[n]=0.8δ[n]代碼:>>L=15;>>nn=(-L):L;>>imp=zeros(2*L+1,1);>>imp(16)=0.8;>>stem(nn,imp())>>ylabel('x2[n]=0.8δ[n]')>>gtext('n')>>grid圖形:1.x3[n]=1.5δ[
2、n-333]代碼:>>L=50;>>nn=6*L:7*L;>>imp=zeros(L+1,1);>>imp(34)=1.5;>>stem(nn,imp())>>ylabel('x3[n]=1.5δ[n-333]')>>gtext('n')>>grid圖形:1.x4[n]=4.5δ[n+7]代碼:>>L=10;>>nn=-L:0;>>imp=zeros(L+1,1);>>imp(4)=4.5;>>stem(nn,imp())>>grid>>ylabel('x4[n]=4.5δ[n+7]')>>gtext('n')圖形:三、指數(shù)信號a.在n=[0:20]區(qū)間繪制指數(shù)信
3、號M文件代碼:functiony=genexp(b,n0,L)if(L<=0)error('GENEXP:lengthnotpositive')endnn=n0+[1:L]'-1;y=b.^nn;End主代碼:>>edit>>y=genexp(0.9,0,21);>>nn=0:20;>>stem(nn,y)>>ylabel('x[n]=(0.9)^n')>>gtext('n')>>grid>>title('指數(shù)信號')圖形:b.證明.利用a題中產(chǎn)生的指數(shù)信號對其求和代碼1:>>y=genexp(0.9,0,21);>>nn=0:20>>sum(y)ans=8.90
4、58代碼2:>>L=21;>>a=0.9;>>m=1-a.^L;>>n=1-a;>>y=m/ny=8.9058由此可以證明等式成立。C.證明等式成立,用a題中的指數(shù)信號代碼1:計算>>y=genexp(0.9,0,21);>>nn=0:20;>>y'ans=Columns1through81.00000.90000.81000.72900.65610.59050.53140.4783Columns9through160.43050.38740.34870.31380.28240.25420.22880.2059Columns17through210.18530.1
5、6680.15010.13510.1216代碼2:計算a*>>y=genexp(0.9,-1,21);>>nn=-1:19;>>a=0.9;>>y1=a*y;>>y1'ans=Columns1through81.00000.90000.81000.72900.65610.59050.53140.4783Columns9through160.43050.38740.34870.31380.28240.25420.22880.2059Columns17through210.18530.16680.15010.13510.1216通過相同項對比可得出等式成立.d.用fi
6、lter函數(shù)證明差分方程的解是代碼:>>a=0.9;>>aa=[1,-a];>>bb=[1,0];>>y0=[0];>>zi=filtic(bb,aa,y0);>>nn=0:20;>>imp=zeros(20+1,1);>>imp(1)=1;>>y=filter(bb,aa,imp,zi);>>stem(nn,y)>>title('y[n]-ay[n-1]=x[n]')>>gtext('t')>>y'ans=Columns1through81.00000.90000.81000.72900.65610.59050.53140.4783Columns9through
7、160.43050.38740.34870.31380.28240.25420.22880.2059Columns17through210.18530.16680.15010.13510.1216方程的圖形如下:部分?jǐn)?shù)值的的代碼:>>y=genexp(0.9,0,21);>>nn=0:20;>>y'ans=Columns1through81.00000.90000.81000.72900.65610.59050.53140.4783Columns9through160.43050.38740.34870.31380.28240.25420.22880.2059Co
8、lumns