Orthogonal Signal BER?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentario
Yukthi S
el 19 de Abr. de 2024
Can you be more specific with what you meant by "binary orthogonal signal"?
Respuestas (1)
Arun
el 25 de Abr. de 2024
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:
- Simulated error rate:
- 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.
- Theoretical error rate:
- 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:
- ‘normrnd’ function: https://www.mathworks.com/help/stats/normrnd.html
- https://dsp.stackexchange.com/questions/15539/probability-error-for-antipodal-systems-and-orthogonal-systems
- https://www.researchgate.net/publication/37409433_Basic_Principles_of_Direct_Chaotic_Communications
Hope this helps.
0 comentarios
Ver también
Categorías
Más información sobre Test and Measurement en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!