北京工業(yè)大學(xué)信號處理工程應(yīng)用訓(xùn)練_第1頁
北京工業(yè)大學(xué)信號處理工程應(yīng)用訓(xùn)練_第2頁
北京工業(yè)大學(xué)信號處理工程應(yīng)用訓(xùn)練_第3頁
北京工業(yè)大學(xué)信號處理工程應(yīng)用訓(xùn)練_第4頁
北京工業(yè)大學(xué)信號處理工程應(yīng)用訓(xùn)練_第5頁
已閱讀5頁,還剩39頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

./北京工業(yè)大學(xué)北京工業(yè)大學(xué)專業(yè):專業(yè):通信工程學(xué)生姓名:劉瑩瑩指導(dǎo)教師:席大林完成時間:Time\@"yyyy年M月d日"2020年6月10日通信系統(tǒng)工程應(yīng)用訓(xùn)練報告.目錄TOC\o"1-3"\h\u9084訓(xùn)練十一DFT性質(zhì)研究129114訓(xùn)練十二DFT及抽樣定理研究1314497訓(xùn)練十三數(shù)字濾波器制作2027638訓(xùn)練十四IIR數(shù)字濾波器設(shè)計與實現(xiàn)258973訓(xùn)練十五線性卷積計算463830訓(xùn)練十六FIR數(shù)字濾波器設(shè)計與實現(xiàn)55.訓(xùn)練十一DFT性質(zhì)研究驗證dft函數(shù)正確性設(shè)置原始輸入信號為x[8]={{1,0},{2,0},{3,0},{4,0},{5,0},{6,0},{7,0},{8,0}},將輸入信號x[8]進(jìn)行DFT正變換,dft<X,x,8,1>,輸出保存在X[8],如下:可以看到,輸入信號x<n>已經(jīng)變換到頻域X<k>,且仍為8位。再對X[8]進(jìn)行DFT反變換,dft<x,X,8,-1>,重新得到x[8],觀察得到的輸出與原始輸入數(shù)據(jù)是否相同。結(jié)果如下:可以看到,輸出的x[8]取值仍為x[8]={{1,0},{2,0},{3,0},{4,0},{5,0},{6,0},{7,0},{8,0}},證明經(jīng)過DFT正反變換后,信號能夠恢復(fù)原始信號。根據(jù)帕塞瓦爾定理,應(yīng)有時域、頻域總能量相等:。經(jīng)過計算,時域、頻域能量和分別為,證明時域、頻域能量和相同,符合帕塞瓦爾定理。綜上,證明DFT變換正確。A、補0效應(yīng)研究原數(shù)組:x[8]={{1,0},{2,0},{3,0},{4,0},{5,0},{6,0},{7,},{8,0}}示例程序中補0后數(shù)組為:x2[16]={{1,0},{2,0},{3,0},{4,0},{5,0},{6,0},{7,0},{8,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}}補0方式我使用的補0方式為:for<i=8;i<13;i++>x2[i]=COMPLEX<0,0>;補0后數(shù)組為:x2[13]={{1,0},{2,0},{3,0},{4,0},{5,0},{6,0},{7,0},{8,0},{0,0},{0,0},{0,0},{0,0},{0,0}}結(jié)果分析與圖在時域中,信號長度增加,由于所增加的項均為零,波形仍與未補0時相同未補零時的信號時域圖補5個零后的信號時域圖補8個零后的信號時域圖經(jīng)過DFT變換后,X<k>長度也會隨著x<n>長度的增加而增加,且增加的值非零未在末端補零時,信號頻譜圖在末端補5個零時,信號頻譜圖在末端補8個零時,信號頻譜圖可以看到,經(jīng)過補0,經(jīng)過DFT變換的頻譜與未補零時形狀基本相同,只是在長度上進(jìn)行擴展,且補零數(shù)量越多,擴展越長??梢岳斫鉃榻?jīng)過補0效應(yīng),增加了頻域采樣頻率,但是由于信號未增加新的信息,因此不能提高物理分辨率。在能量上,補5/8個零時,信號能量時域、頻域能量和如下:時域能量和、頻域能量和始終相等,符合帕塞瓦爾定理,且能量與未插值時的相同。B、插值效應(yīng)研究原數(shù)組:x[8]={{1,0},{2,0},{3,0},{4,0},{5,0},{6,0},{7,},{8,0}}示例程序中插值后數(shù)組為:x3[16]={{1,0},{8,0},{2,0},{7,0},{3,0},{6,0},{4,0},{5,0},{5,0},{4,0},{6,0},{3,0},{7,0},{2,0},{8,0},{1,0}}插值方式我使用的插值方式為:for<i=0;i<16;i=i+2>{x3[i]=COMPLEX<1+i/2,0>;x3[i+1]=COMPLEX<i*0.5+2.5,0>;}插值后數(shù)組為:x[16]={{1,0},{3,0},{2,0},{4,0},{3,0},{5,0},{4,0},{6,0},{5,0},{7,0},{6,0},{8,0},{7,0},{9,0},{8,0},{10,0}}結(jié)果分析與圖<1>在示例程序中,在x[8]={{1,0},{2,0},{3,0},{4,0},{5,0},{6,0},{7,0},{8,0}}中反向插入原序列,使原序列變?yōu)閤3[16]={{1,0},{8,0},{2,0},{7,0},{3,0},{6,0},{4,0},{5,0},{5,0},{4,0},{6,0},{3,0},{7,0},{2,0},{8,0},{1,0}},再進(jìn)行DFT變換,觀察頻譜,對比時域、頻域能量和。反向插值后,時域、頻域圖可以看到,反向插值后,信號頻譜有了很大的直流分量,且近乎左右對稱。從三維頻譜圖上可以看出,高頻、低頻部分實際上是共軛反對稱:反向插值后,三維頻域圖。符合帕塞瓦爾定理,且能量是未插值時的2倍。<2>在x[8]={{1,0},{2,0},{3,0},{4,0},{5,0},{6,0},{7,0},{8,0}}中插入序列{{3,0},{4,0},{5,0},{6,0},{7,0},{8,0},{9,0},{10,0}},使原序列變?yōu)閤3[16]={{1,0},{3,0},{2,0},{4,0},{3,0},{5,0},{4,0},{6,0},{5,0},{7,0},{6,0},{8,0},{7,0},{9,0},{8,0},{10,0}},再進(jìn)行DFT變換,觀察頻譜,對比時域、頻域能量和。插值后,時域、頻域圖可以看到,插值后,信號頻譜有了很大的直流分量,且近乎左右對稱。,符合帕塞瓦爾定理。<3>在x[8]={{1,0},{2,0},{3,0},{4,0},{5,0},{6,0},{7,0},{8,0}}中正向插入原序列,使原序列分別變?yōu)閤2[16]={{1,0},{1,0},{2,0},{2,0},{3,0},{3,0},{4,0},{4,0},{5,0},{5,0},{6,0},{6,0},{7,0},{7,0},{8,0},{8,0}},再進(jìn)行DFT變換,觀察頻譜,對比時域、頻域能量和。正向插值后,時域、頻域圖可以看到,正向插值后,信號頻譜有了很大的直流分量,且近乎左右對稱。。符合帕塞瓦爾定理,且能量是未插值時的2倍。C、插0效應(yīng)研究原數(shù)組:x[8]={{1,0},{2,0},{3,0},{4,0},{5,0},{6,0},{7,},{8,0}}示例程序中插0后數(shù)組為:x4[16]={{1,0},{0,0},{2,0},{0,0},{3,0},{0,0},{4,0},{0,0},{5,0},{0,0},{6,0},{0,0},{7,0},{0,0},{8,0},{0,0}}插0方式我使用的插0方式為:for<i=0;i<16;i=i+3>{x4[i]=COMPLEX<1+i/2,0>;x4[i+1]=COMPLEX<2+i/2,0>;x4[i+2]=COMPLEX<0,0>;}插0后數(shù)組為:x4[12]={{1,0},{2,0},{0,0},{3,0},{4,0},{0,0},{5,0},{6,0},{0,0},{7,0},{8,0},{0,0}}結(jié)果分析與圖在示例程序中,在x[8]={{1,0},{2,0},{3,0},{4,0},{5,0},{6,0},{7,0},{8,0}}中,每隔一點,插入1個0值,使原序列分別變?yōu)閤1[16]={{1,0},{0,0},{2,0},{0,0},{3,0},{0,0},{4,0},{0,0},{5,0},{0,0},{6,0},{0,0},{7,0},{0,0},{8,0},{0,0}},再進(jìn)行DFT變換,觀察頻譜,對比時域、頻域能量和。插0前,時域、頻域圖插0后,時域、頻域圖可以看到,插0后的頻譜是對原始信號頻譜的周期延拓。畫出三維圖像,可以更直觀地看出周期延拓關(guān)系:未插入零/插入一個零后的三維頻譜圖通過對插零后圖像進(jìn)行DFT運算,可以證明插零后的DFT是原信號DFT的周期延拓。。符合帕塞瓦爾定理,且能量與未插值時的相同。在x[8]={{1,0},{2,0},{3,0},{4,0},{5,0},{6,0},{7,0},{8,0}}中,每隔兩點,插入1個0值,使原序列變?yōu)閤4[16]={{1,0},{2,0},{0,0},{3,0},{4,0},{0,0},{5,0},{6,0},{0,0},{7,0},{8,0},{0,0}},再進(jìn)行DFT變換,觀察頻譜,對比時域、頻域能量和。插0后,時域、頻域圖符合帕塞瓦爾定理源程序://11yy.cpp:Definestheentrypointfortheconsoleapplication.//#include"stdafx.h"#include"D:\xhclgcyy\x_math.cpp"#include"D:\xhclgcyy\x_graph.cpp"voidplotgri2<COLORREFgridcolor,COLORREFlinecolor,COMPLEXp[],intN>{inti;HPENpen1=CreatePen<PS_SOLID,1,gridcolor>,oldpen=<HPEN>SelectObject<win3.hdc,pen1>;HPENpen2=CreatePen<PS_SOLID,1,linecolor>;for<i=0;i<N;i++>line2<i,0,i,abs<p[i]>>;SelectObject<win3.hdc,pen2>;moveto2<0,p[0].r>;for<i=0;i<N;i++>lineto2<i,abs<p[i]>>;SelectObject<win2.hdc,oldpen>;DeleteObject<pen1>;DeleteObject<pen2>;}voidplotgri3<COLORREFgridcolor,COLORREFlinecolor,COMPLEXp[],intN>{inti;HPENpen1=CreatePen<PS_SOLID,1,gridcolor>,oldpen=<HPEN>SelectObject<win3.hdc,pen1>;HPENpen2=CreatePen<PS_SOLID,1,linecolor>;for<i=0;i<N;i++>line3<i,0,0,i,p[i].r,p[i].i>;SelectObject<win3.hdc,pen2>;moveto3<0,p[0].r,p[0].i>;for<i=0;i<N;i++>lineto3<i,p[i].r,p[i].i>;SelectObject<win2.hdc,oldpen>;DeleteObject<pen1>;DeleteObject<pen2>;}voidmain<>{inti;doublesumT,sumF;COMPLEXx[8],//{{1,0},{2,0},{3,0},{4,0},{5,0},{6,0},{7,},{8,0}} X[8], x2[13],//={{1,0},{2,0},{3,0},{4,0},{5,0},{6,0},{7,0},{8,0},{0,0},{0,0},{0,0},{0,0},{0,0}} X2[16], x3[16],//={{{1,0},{1,0},{2,0},{2,0},{3,0},{3,0},{4,0},{4,0},{5,0},{5,0},{6,0},{6,0},{7,0},{7,0},{8,0},{8,0}}} X3[16], x4[12],//={{1,0},{2,0},{0,0},{3,0},{4,0},{0,0},{5,0},{6,0},{0,0},{7,0},{8,0},{0,0}} X4[16];//給待變換的復(fù)數(shù)數(shù)組賦值:for<i=0;i<8;i++>{x[i]=COMPLEX<i+1,0>;X[i]=COMPLEX<0,0>;}for<i=0;i<8;i++>x2[i]=COMPLEX<i+1,0>;for<i=8;i<13;i++>x2[i]=COMPLEX<0,0>;for<i=0;i<16;i=i+2>{x3[i]=COMPLEX<1+i/2,0>;x3[i+1]=COMPLEX<1+i/2,0>;}for<i=0;i<16;i=i+3>{x4[i]=COMPLEX<1+i/2,0>;x4[i+1]=COMPLEX<2+i/2,0>;x4[i+2]=COMPLEX<0,0>;}//第1步:驗證dft函數(shù)正確性dft<X,x,8,1>;for<i=0;i<8;i++>printf<"X[%d]=%f+%f\n",i,X[i].r,X[i].i>;getch<>;dft<x,X,8,-1>;for<i=0;i<8;i++>printf<"x[%d]=%f+%f\n",i,x[i].r,x[i].i>;getch<>;for<sumT=0,sumF=0,i=0;i<8;i++>{ sumT=sumT+x[i].r*x[i].r; sumF=sumF+X[i].r*X[i].r+X[i].i*X[i].i;}printf<"時域能量和=%f,頻域能量和=%f\n",sumT,sumF/8.0>;window2<"函數(shù)圖形顯示",-20,40,20,-20,"t","f<t>">;xy2<BLUE>;plotgri2<BLUE,RED,X,8>;getch<>;frame2<win2.xstr,win2.ystr>;xy2<BLUE>;plotgri2<BLUE,RED,x,8>;getch<>;window3<"周期信號頻譜圖",-1,-12,-12,20,12,12,"N","r","i">;xyz3<BLUE>;plotgri3<BLUE,RED,X,8>;getch<>;frame3<>;xyz3<BLUE>;plotgri3<BLUE,RED,x,8>;getch<>;//第2步:補0效應(yīng)dft<X2,x2,13,1>;for<i=0;i<13;i++>printf<"X2[%d]=%f+%f\n",i,X2[i].r,X2[i].i>;getch<>;dft<x2,X2,13,-1>;for<i=0;i<13;i++>printf<"x2[%d]=%f+%f\n",i,x2[i].r,x2[i].i>;getch<>;for<sumT=0,sumF=0,i=0;i<13;i++>{ sumT=sumT+x2[i].r*x2[i].r; sumF=sumF+X2[i].r*X2[i].r+X2[i].i*X2[i].i;}printf<"時域能量和=%f,頻域能量和=%f\n",sumT,sumF/16.0>;window2<"函數(shù)圖形顯示",-20,40,20,-20,"t","f<t>">;xy2<BLUE>;plotgri2<BLUE,RED,X2,13>;getch<>;frame2<win2.xstr,win2.ystr>;xy2<BLUE>;plotgri2<BLUE,RED,x2,13>;getch<>;window3<"周期信號頻譜圖",-1,-12,-12,20,12,12,"N","r","i">;xyz3<BLUE>;plotgri3<BLUE,RED,X,13>;getch<>;frame3<>;xyz3<BLUE>;plotgri3<BLUE,RED,x,13>;getch<>;//第3步:插值效應(yīng)dft<X3,x3,16,1>;for<i=0;i<16;i++>printf<"X3[%d]=%f+%f\n",i,X3[i].r,X3[i].i>;getch<>;dft<x3,X3,16,-1>;for<i=0;i<16;i++>printf<"x3[%d]=%f+%f\n",i,x3[i].r,x3[i].i>;getch<>;for<sumT=0,sumF=0,i=0;i<16;i++>{ sumT=sumT+x3[i].r*x3[i].r; sumF=sumF+X3[i].r*X3[i].r+X3[i].i*X3[i].i;}printf<"時域能量和=%f,頻域能量和=%f\n",sumT,sumF/16.0>;window2<"函數(shù)圖形顯示",-20,20,20,-20,"t","f<t>">;xy2<BLUE>;plotgri2<BLUE,RED,X3,16>;getch<>;frame2<win2.xstr,win2.ystr>;xy2<BLUE>;plotgri2<BLUE,RED,x3,16>;getch<>;window3<"周期信號頻譜圖",-1,-12,-12,20,12,12,"N","r","i">;xyz3<BLUE>;plotgri3<BLUE,RED,X3,16>;getch<>;frame3<>;xyz3<BLUE>;plotgri3<BLUE,RED,x3,16>;getch<>;//第4步:插0效應(yīng)dft<X4,x4,12,1>;for<i=0;i<12;i++>printf<"X4[%d]=%f+%f\n",i,X4[i].r,X4[i].i>;getch<>;dft<x4,X4,12,-1>;for<i=0;i<12;i++>printf<"x4[%d]=%f+%f\n",i,x4[i].r,x4[i].i>;getch<>;for<sumT=0,sumF=0,i=0;i<12;i++>{ sumT=sumT+x4[i].r*x4[i].r; sumF=sumF+X4[i].r*X4[i].r+X4[i].i*X4[i].i;}printf<"時域總和=%f,頻域總和=%f\n",sumT,sumF/12.0>;window2<"函數(shù)圖形顯示",-20,40,20,-20,"t","f<t>">;xy2<BLUE>;plotgri2<BLUE,RED,X4,12>;getch<>;frame2<win2.xstr,win2.ystr>;xy2<BLUE>;plotgri2<BLUE,RED,x4,12>;getch<>;window3<"周期信號頻譜圖",-1,-12,-12,20,12,12,"N","r","i">;xyz3<BLUE>;plotgri3<BLUE,RED,X4,12>;getch<>;frame3<>;xyz3<BLUE>;plotgri3<BLUE,RED,x4,12>;getch<>;}訓(xùn)練十二DFT及抽樣定理研究D、給定單頻信號抽樣1.對給定信號x<t>=sin<2πfct>,fc==50,N=264進(jìn)行抽樣,抽樣頻率分布為100Hz,110Hz,200Hz,230Hz,250Hz。單頻信號抽樣示意圖關(guān)于能量泄露的問題:1.計算時域能量、頻域能量。觀察是否滿足Et=Ef=2|X50|2/N,若抽樣頻率正確,即無泄漏。fs=110Hzfs=200HzFs=230Hzfs=250Hz抽樣定理指出,若信號x<t>的最高頻率為fc,當(dāng)抽樣頻率fs