-
大小: 2KB文件类型: .m金币: 1下载: 0 次发布日期: 2021-01-07
- 语言: Matlab
- 标签: coopertive
资源简介
协作通信中的中继端利用amplify-and-forward协议
转发信息
代码片段和文件信息
function [p]=AF(snr_in_dB)
% [p]=smldPe55(snr_in_dB)
% SMLDPE55 simulates the probability of error for the particular
% value of snr_in_dB signal-to-noise ratio in dB.
E=1;
H0=1;
H1=10;
H2=1;
SNR=10^(snr_in_dB/10); % signal-to-noise ratio
sgma=E/sqrt(2*SNR); % sigma standard deviation of noise
N=10000;
numoferr=0;
for i=1:N
% Generation of the binary data source follows
temp=rand; % a uniform random variable over (01)
if (temp<0.5)
dsource(i)=0; % With probability 1/2 source output is 0.
else
dsource(i)=1; % With probability 1/2 source output is 1.
end
% The detection and probability of error calculation follows.
H0=normrnd(0sqrt(0.5))+j*normrnd(0sqrt(0.5));
H1=normrnd(0sqrt(0.
评论
共有 条评论