資源簡介
bpsk在高斯白噪聲信道中調制解調MATLAB仿真及誤碼率

代碼片段和文件信息
function[p]=cm_bpske(snr_in_db)
%?[p]=cm_bpske(snr_in_db)
%?cm_bpske?finds?the?probability?of?error?for?the?given?value?of?snr_in_db
N=5000;
E=1;????????????????????????????%energy?per?symbol
snr=10^(snr_in_db/10);?????????%signal?to?noise?ratio
sgma=E/sqrt(snr*2);???????????%noise?variance
%generation?of?data?source
for?i=1:N
????temp=rand;
????if(temp<0.5)
????????dsource(i)=0;
????else
????????dsource(i)=1;
????end
end
%detection?and?the?probability?of?errror?calculation
numofbiterror=0;
for?i=1:N
????%received?signal?at?the?detector?for?the?ith?symbol?is:
???????if?(dsource(i)==0)
????????r0=E+gngauss(sgma);
????????r1=gngauss(sgma);
????else
????????r1=E+gngauss(sgma);
????????r0=gngauss(sgma);
????end
????
????
????%?the?detector?is:
????if(r0>r1)
????????decis=0;
????else
????????decis=1;
????end
????????
????%increment?the?error?counterif?the?decision?is?not?correct
????if?(decis~=dsource(i))
????????numofbiterror=numofbiterror+1;
????end
????
end
p=numofbiterror/N;
????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????1048??2003-08-10?12:05??AWGN\cm_bpske.m
?????文件????????711??2003-08-10?14:12??AWGN\gngauss.m
?????文件????????735??2003-08-10?12:02??AWGN\trng_guass.m
????..AD...?????????0??2003-08-11?12:19??AWGN
-----------?---------??----------?-----??----
?????????????????2494????????????????????4
- 上一篇:基于MATLAB的圖像增強處理
- 下一篇:有約束的最小最大值matlab程序
評論
共有 條評論