【正文】
化到6^2=1,而通過給信號能量參數(shù)E加權(quán)來控制接收信號中的SNR。檢測器觀察到接收信號向量r=Sm+n,由 程序:for i=1:N, % The received signal at the detector, for the ith symbol, is: n(1)=gngauss(sgma)。 if ((dsource1(i)==0) amp。 elseif ((dsource1(i)==0) amp。 elseif ((dsource1(i)==1) amp。 else r=s11+n。我做的部分::最大投影法將接收到的信號向量r投射到M個可能的傳輸信號向量之一上去,并選取對應(yīng)于最大投影的向量。所以《現(xiàn)代通信系統(tǒng)matlab版(第二版)》: c00=dot(r,s00)。 c10=dot(r,s10)。 % The decision on the ith symbol is made next. c_max=max([c00 c01 c10 c11])。 decis2=0。 decis2=1。 decis2=0。 decis2=1。 其中C=dot(A,B,DIM)表示返回向量A與B在維數(shù)為DIM的點積,而c_max=max([c00 c01 c10 c11])。 方法二:根據(jù)設(shè)計要求,用另一種檢測器。根據(jù),將加性噪聲分解成兩路,加入噪聲后的二維向量為。 再求出信號集{}中選取其相位最接近的信號,通過求相位角angle函數(shù)代替actan函數(shù): if (angle(rr)(3*pi/4)amp。 decis2=1。angle(rr)=(3*pi/4)), decis1=1。 elseif (angle(rr)(pi/4)amp。 decis2=1。angle(rr)=(pi/4)), decis1=0。 elseif(angle(rr)(3*pi/4)amp。 decis2=0。,最后對符號差錯和比特差錯計數(shù)。程序:symbolerror=0。 symbolerror=1。 if (decis2~=dsource2(i)), numofbiterror=numofbiterror+1。 end。 end。ps=numofsymbolerror/N。 % since 2N bits are transmitted~Pm/2,對應(yīng)的理論差錯概率。 % signaltonoise ratio theo_err_prb(i)=Qfunct(sqrt(2*SNR))。end。試驗中用的是將r向量與作為標準的s向量作向量積后選取最大者的方法。我們得出的仿真結(jié)果誤碼率是:七、心得與體會在完成這次課程設(shè)計的過程中我們查閱關(guān)于通信系統(tǒng)原理和MATLAB編程等方面的資料。通過在MATLAB平臺上進行M文件編程,增強系統(tǒng)分析與設(shè)計數(shù)字通信系統(tǒng)的技能,有效地提高Matlab的應(yīng)用能力。參考文獻資料:相關(guān)的現(xiàn)代通信系統(tǒng)原理;相關(guān)的數(shù)字信號處理原理;相關(guān)的MATLAB編程教材和文獻;主要參考文獻:[1] John G. Proakis等著,劉樹棠譯,現(xiàn)代通信系統(tǒng)(MATLAB版)(第二版)[M].北京:電子工業(yè)出版社,2005.[2] 張志涌,楊祖櫻,MATLAB教程[M].北京:北京航天航空大學(xué)出版社,2006.附錄(Matlab代碼)主程序:% MATLAB script for Illustrative Problem .echo onSNRindB1=0:2:10。for i=1:length(SNRindB1), [pb,ps]=cm_sm322(SNRindB1(i))。 smld_symbol_err_prb(i)=ps。end。for i=1:length(SNRindB2), SNR=exp(SNRindB2(i)*log(10)/10)。 % theoretical biterror rate echo off 。echo on 。*39。holdsemilogy(SNRindB1,smld_symbol_err_prb,39。)。 legend(39。,39。,39。,1)。信噪比/dB39。概率P39。% CM