Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Matlab 环境反向散射通信系统的实现_Matlab_Wireless - Fatal编程技术网

Matlab 环境反向散射通信系统的实现

Matlab 环境反向散射通信系统的实现,matlab,wireless,Matlab,Wireless,我从研究论文中为最大似然检测器开发了Matlab代码。我的问题是代码正在运行,但我的BER曲线不正确,即,我的BER值有时会减小或增大。这篇论文的标题是《半相干检测与性能》 环境后向散射系统分析“。请提前感谢。还附加了算法的图像 `clc; 清除所有; 全部关闭; %初始化 Nw=1;%噪声方差 M=50;%标签的符号周期 Mt=4;%训练符号 al=0.5;%alpha是标签系数 L=1000; N_mc=10^6; N=50;%s(n)的连续样品 RCD=0.5;%相对通道差异。 SNRdB

我从研究论文中为最大似然检测器开发了Matlab代码。我的问题是代码正在运行,但我的BER曲线不正确,即,我的BER值有时会减小或增大。这篇论文的标题是《半相干检测与性能》 环境后向散射系统分析“。请提前感谢。还附加了算法的图像

`clc;
清除所有;
全部关闭;
%初始化
Nw=1;%噪声方差
M=50;%标签的符号周期
Mt=4;%训练符号
al=0.5;%alpha是标签系数
L=1000;
N_mc=10^6;
N=50;%s(n)的连续样品
RCD=0.5;%相对通道差异。
SNRdB=0:5:20;
%来源
sn=sqrt(1/2)*(randn(1,L)+1i*randn(1,L));
Ps=1;%射频源信号功率
%渠道
hst=sqrt(1/2)*(randn(1,L)+1i*randn(1,L));
hsr=sqrt(1/2)*(randn(1,L)+1i*randn(1,L));
vn=10;%高温气冷堆的var
htr=sqrt(vn/2)*(randn(1,L)+1i*randn(1,L));
wn=sqrt(1/2)*(randn(1,L)+1i*randn(1,L));
ho=高铁;
ho_abs=sqrt(总和(abs(ho)^2));
h1=(高铁)+(铝*(高铁。*高铁));
h1_abs=sqrt(总和(abs(h1)^2));
%阈值
二氧化硫=((ho_abs)^2*Ps)+Nw;%四茂广场
s12=((h1_abs)^2*Ps)+Nw;%西格玛广场
ThCG=((N*so2*s12)/(s12-so2))*对数(s12/so2);%复高斯最优检测器的阈值。
%读取器
I=眼睛(N);
vn_yo=so2*I;
y_-Ho=sqrt(vn_-yo/2)。*(randn(N,N)+1i*randn(N,N));%矩阵
vn_y1=s12*I;
y_H1=sqrt(vn_y1/2)。*(randn(N,N)+1i*randn(N,N));%矩阵
y_bar_H1=诊断(y_H1);
y_bar_Ho=诊断(y_Ho);
z=标准值(y_bar_H1);
Z=Z^2;
Nid=1000;%错误位决定的数量
对于i=1:长度(SNRdB)
errcnt=0;
bitcnt=0;
而errcnt1/2);
如果d==1
y_bar_H1=诊断(y_H1);
结束
如果d==0
y_bar_Ho=诊断(y_Ho);
结束
如果so2>s12
如果Z>ThCG
dhat=0;
其他的
dhat=1;
Z>ThCG的结束百分比
其他的
如果Z
`clc;
clear all;
close all;

% Initialization


Nw = 1; % noise variance
M = 50 ; % symbol period of the tag
Mt = 4; % training symbols 
al = 0.5 ; % alpha is tag coefficient
L = 1000;
N_mc = 10^6;
N = 50; % comsecutive samples of s(n)
RCD = 0.5;% Relative channel difference.
SNRdB = 0:5:20; 

% source 
sn = sqrt(1/2)*(randn(1,L)+1i*randn(1,L));
Ps = 1; % RF source signal power


% channels
hst = sqrt(1/2)*(randn(1,L)+1i*randn(1,L));
hsr = sqrt(1/2)*(randn(1,L)+1i*randn(1,L));

vn = 10; % var of htr
htr = sqrt(vn/2)*(randn(1,L)+1i*randn(1,L));

wn =  sqrt(1/2)*(randn(1,L)+1i*randn(1,L));

ho = hsr;
ho_abs = sqrt(sum(abs(ho).^2));
h1 = (hsr)+ (al*(hst.*htr));
h1_abs = sqrt(sum(abs(h1).^2));


% Thresholds
so2 = ((ho_abs)^2*Ps)+Nw;% sigmao square

s12 = ((h1_abs)^2*Ps)+Nw; % sigma1 square

ThCG = ((N*so2*s12)/(s12-so2))*log(s12/so2); % threshold for complex gaussian optimal detector.

% Reader
I = eye(N);
vn_yo = so2*I;
y_Ho = sqrt(vn_yo/2).*(randn(N,N)+1i*randn(N,N)); % matrix

vn_y1 = s12*I;
y_H1 = sqrt(vn_y1/2).*(randn(N,N)+1i*randn(N,N)); % matrix

y_bar_H1 = diag(y_H1);
y_bar_Ho = diag(y_Ho);
z = norm(y_bar_H1);
Z = z^2;


Nid = 1000; % number of incorrect bit decisions

for i = 1:length(SNRdB)
errcnt = 0;
bitcnt = 0;
while errcnt < Nid
    d = (rand > 1/2);
        if d == 1
        y_bar_H1 = diag(y_H1);
        end

         if d == 0
            y_bar_Ho = diag(y_Ho);
         end
if so2 > s12
    if Z > ThCG
        dhat = 0; 
    else
        dhat = 1;
    end % for Z>ThCG
else
    if Z < ThCG
        dhat = 0;
    else
        dhat = 1;
    end
end

if dhat ~= d
     errcnt = errcnt+1;
end
     bitcnt = bitcnt+1;  
end
BER(i) = errcnt/bitcnt;  
end

figure
grid on;
semilogy(SNRdB, BER);
`