Orthogonal Signal BER?

9 ビュー (過去 30 日間)
DAMLA YAgMUR
DAMLA YAgMUR 2024 年 4 月 3 日
回答済み: Arun 2024 年 4 月 25 日
Hi everyone,
I use this code for BER for binary antipodal signal. But I want to implement binary orthogonal signal. How Can I do that?
snr1=0:1:10;
snr2=0:0.1:10;
r=zeros(1,length(snr1));
for i=1:length(snr1)
r(i)=r(i)+proberr(snr1(i)); % simulated error rate
end;
d=zeros(1,length(snr2));
for i=1:length(snr2),
SNR=exp(snr2(i)*log(10)/10);
d(i)=d(i)+qfunc(sqrt(2*SNR)); % theoretical error rate.
end;
figure;
semilogy(snr1,r,'r*'); % estimation probability of error
hold
semilogy(snr2,d); % Theoretical probability of error
title('Binary antipodal communication system');
xlabel('SNR in dB');
ylabel('prob. of error');
function [p]=proberr(s)
E=1;
SNR=10^(s/10); % Signal to noise ratio
sgma=E/sqrt(2*SNR); % std. Deviation of Noise
N=10000;
for i=1:N, % generation of binary data source
temp=rand;
if(temp<0.5),
dsource(i)=0;
else
dsource(i)=1;
end
end;
numoferr=0; % the detection and probability of error calculation
for i=1:N,
if(dsource(i)==0) % dsource = 0
r=-E+normrnd(0,sgma); % if the source output is 0
else
r=E+normrnd(0,sgma); % if the source output is 1
end;
if(r<0),
decis=0; %decision is "0"
else
decis=1; %decision is "1"
end;
if(decis~=dsource(i)), % if decision is not equal to source bit
numoferr=numoferr+1; % if above is error then increase error content
end;
end;
p= numoferr/N; % probability of error estimate
  1 件のコメント
Yukthi S
Yukthi S 2024 年 4 月 19 日
Can you be more specific with what you meant by "binary orthogonal signal"?

サインインしてコメントする。

回答 (1 件)

Arun
Arun 2024 年 4 月 25 日
Hi Dalmla,
I understand that you want to implement Bit Error Rate (BER) for binary orthogonal signal, similar to the implementation of BER for antipodal signal that you shared.
To implement BER for binary orthogonal signal you can modify the shared code to accurately calculate:
  1. Simulated error rate:
  2. Modify the function proberr, by applying the appropriate formula for standard deviation (sgma), the r value and decision (decis) to give correct simulated error rate.
  3. Theoretical error rate:
  4. Utilize the correct formula within qfunc according to orthogonal signal.
Below is a sample modified code that you can use as a starting point:
snr1 = 0:1:10;
snr2 = 0:0.1:10;
r = zeros(1, length(snr1));
for i = 1:length(snr1)
r(i) = r(i) + proberr_orthogonal(snr1(i)); % simulated error rate for orthogonal signaling
end
d = zeros(1, length(snr2));
for i = 1:length(snr2)
SNR = exp(snr2(i) * log(10) / 10);
d(i) = d(i) + qfunc(sqrt(SNR)); % theoretical error rate for orthogonal signaling.
end
figure;
semilogy(snr1, r, 'r*'); % estimation probability of error for orthogonal signaling
hold on;
semilogy(snr2, d); % Theoretical probability of error for orthogonal signaling
title('Binary orthogonal communication system');
xlabel('SNR in dB');
ylabel('prob. of error');
function [p] = proberr_orthogonal(s)
E = 1;
SNR = 10^(s / 10); % Signal to noise ratio
sgma = sqrt(E / (2 * SNR)); % std. Deviation of Noise for orthogonal signaling
N = 10000;
numoferr = 0; % the detection and probability of error calculation
for i = 1:N
% generation of binary data source
dsource = rand > 0.5;
% Orthogonal signaling: Use different schemes for 0 and 1
if dsource == 0
r = normrnd(0, sgma); % Received signal for "0"
else
r = sqrt(2*E) + normrnd(0, sgma); % Received signal for "1"S
end
% Decision based on threshold, which can be adjusted based on signal design
decis = r > sqrt(2*E)/2;
if decis ~= dsource % if decision is not equal to source bit
numoferr = numoferr + 1; % if above is error then increase error content
end
end
p = numoferr / N; % probability of error estimate
end
Here are few links that might be useful:
  1. normrnd’ function: https://www.mathworks.com/help/stats/normrnd.html
  2. https://dsp.stackexchange.com/questions/15539/probability-error-for-antipodal-systems-and-orthogonal-systems
  3. https://www.researchgate.net/publication/37409433_Basic_Principles_of_Direct_Chaotic_Communications
Hope this helps.

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by