资源简介
QPSK卷积码程序,值得一看,带有图和完整的程序

代码片段和文件信息
function [pb1ps1pe1]=cm_sm32(snr_in_dB)
% [pbps]=cm_sm32(snr_in_dB)
% CM_SM3 finds the probability of bit error and symbol error for
% the given value of snr_in_dB signal to noise ratio in dB.
N=10000;
E=1; % energy per symbol
snr=10^(snr_in_dB/10); % signal to noise ratio
sgma=sqrt(E/snr)/2; % noise variance
s00=[1 0]; s01=[0 1]; s11=[-1 0]; s10=[0 -1]; % signal mapping
% generation of the data source
numofsymbolerror=0;
numofbiterror=0;
counter=0;
while(numofbiterror<100)
for i=1:N
temp=rand; j=2*i; % a uniform random variable between 0 and 1
if (temp<0.25) % with probability 1/4 source output is “00“
dsource(1j-1)=0; dsource(1j)=0;
elseif (temp<0.5) % with probability 1/4 source output is “01“
dsource(1j-1)=0; dsource(1j)=1;
elseif (temp<0.75) % with probability 1/4 source output is “10“
dsource(1j-1)=1; dsource(1j)=0;
else % with probability 1/4 source output is “11“
dsource(1j-1)=1; dsource(1j)=1;
end;
end;
% detection and the probability of error calculation
encodesource=convolutionencode(dsource);
for i=1:N
% the received signal at the detection for the ith symbolis:
n=sgma*randn(12); j=2*i; % 2 normal distributed r.v with 0 variance sgma
if ((encodesource(1j-1)==0) & (encodesource(1j)==0))
r=s00+n;
elseif ((encodesource(1j-1)==0) & (encodesource(1j)==1))
r=s01+n;
elseif ((encodesource(1j-1)==1) & (encodesource(1j)==0))
r=s10+n;
else
r=s11+n;
end;
% The correlation metrics are computed below
c00=dot(rs00); c01=dot(rs01); c10=dot(rs10); c11=dot(rs11);
% The decision on the ith symbol is made next
c_max=max([c00c01c10c11]);
if (c00==c_max) decis1=0; decis2=0;
elseif (c01==c_max) decis1=0; decis2=1;
elseif (c10==c_max) decis1=1; decis2=0;
else decis1=1; decis2=1;
end;
% Increment the error counter if the decision is not correct
symbolerror=0;
if (decis1~=encodesource(1j-1)) numofbiterror=numofbiterror+1; symbolerror=1;
end;
if (decis2~=encodesource(1j)) numofbiterror=numofbiterror+1; symbolerror=1;
end;
if (symbolerror==1) numofsymbolerror=numofsymbolerror+1;
end;
decode(1j-1)=decis1; decode(1j)=decis2;
end
counter=counter+1;
end
ps1=numofsymbolerror/(N*counter); % since there are totally N symbols
pb1=numofbiterror/(2*N*counter); % since 2N bits are transmitted
count=0;
correctcode=viterbidecode(decode)
for i=1:N-1
if correctcode(1i)~=dsource(1i)
count=count+1;
end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 151040 2009-11-25 00:14 图.doc
文件 3071 2009-11-25 00:08 cm_sm33.m
文件 1561 2009-11-21 14:17 convolutionencode.m
文件 137 2009-11-23 17:10 equal.m
文件 191 2008-10-22 10:36 hamm_dist.m
文件 1395 2009-11-25 00:12 QPSK_System_BER_Simulation.m
文件 6441 2009-11-24 15:46 viterbidecode.m
----------- --------- ---------- ----- ----
163836 7
相关资源
- 编程实现二维DCT变换
- 图像二值化
- 在高斯白噪声信道下的QPSK编码误码率
- 用FFT对信号进行频谱分析
-
simuli
nk 课程设计 qpsk - Tone-Reservation
- QGA 量子遗传算法
- 差分形式的阻滞增长模型
- 遗传算法的M文件
- 简单二阶互联系统的非线性动力学分
- 移动通信实验现代数字调制、解调实
- 手写数字识别-模板匹配法
- Stock_Watson_动态因子分析模型
- 果蝇优化算法优化支持向量回归程序
- 自己做的一个简单GUI扑克纸牌识别-
- multi output SVR
- AR过程的线性建模过程与各种功率谱估
- PCNN TOOLBOX
- plstoolbox.zip
- 中国国家基础地理信息系统GIS数据
- 粒子群微电网优化调度
- 矩阵分析-经典教材-中文版-Roger.A.Ho
- 压缩感知TwIST
- 使用半分析半仿真的方法进行QPSK系统
- 基于最小错误率的贝叶斯手写数字分
- 最全系统辨识源代码,包括多种最小
- 导弹制导实验
- 画跟踪精确度图的程序.zip
- 重力场大地水准面及重力异常阶次误
- prtools5.2.3工具包
评论
共有 条评论