我环顾四周,但找不到在 matlab 中模拟二进制不对称通道的解决方案。我应该模拟一个 BSC(二进制对称通道)以及一个不对称通道,误差概率为 0.001。
我设法进行二进制对称模拟(对于想要使用它的人)
r = rand(1000000,1); % uniform data set generation
x = zeros(1000000,1); % data to be sent initialised
for i = 1:1000000 % mapped to BPSK signal (-1,1)
if r(i,1) >= 0.5
x(i,1) = 1;
else
x(i,1) = -1;
end
end
SNR = qfuncinv(0.001);
SNRdB = 10*log(SNR);
y = awgn(x,SNRdB);
y = awgn(x,9.79982258); %noise added to inputs through Signal to noise
%ratio
for i = 1:1000000
if(abs(y(i,1) - 1) < abs(y(i,1) + 1) ) %between -1 and 1
y(i,1) = 1; %map back through
else %minimum distance estimations
y(i,1) = -1;
end
if(x(i,1) == y(i,1)) % determine if estimation errors are made
r(i,1) = 0;
else
r(i,1) = 1;
end
end
errors = sum(r);
sprintf('%0.8f',errors/1000000) %show error percentage
好吧,我仍然需要进行非对称通道模拟,但找不到使用 matlab 完成此任务的线索。
将感谢任何解决此问题的实现的链接