Why OQPSK matlab's function ber is differ?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I am testing the PSK series myself.
I check the BER curve, but only OQPSK is different from the theory. What is the problem?
Where does the 6dB difference from QPSK come from?
clc
clear all;
close all;
snr = -2:1:10;
numframes = 100;
ber = comm.ErrorRate; %bpsk
ber2 = comm.ErrorRate; %qpsk
ber3 = comm.ErrorRate('ReceiveDelay',2); %oqpsk
ber_grape = zeros(1,length(snr));
ber_grape2 = zeros(1,length(snr));
ber_grape3 = zeros(1,length(snr));
ebno = convertSNR(snr,'snr','ebno',BitsPerSymbol=1);
ebno2 = convertSNR(snr,'snr','ebno',BitsPerSymbol=2);
ebno3 = convertSNR(snr,'snr','ebno',BitsPerSymbol=2);
oqpskmod=comm.OQPSKModulator('BitInput',true);
oqpskdemod=comm.OQPSKDemodulator('BitOutput',true);
for ii = 1:length(snr)
for counter = 1:numframes
data = randi([0 1],10000,1,'int8');
%BPSK
modSignal = pskmod(data,2,InputType='bit');
[rxsig, noisevar] = awgn(modSignal,snr(ii));
demodSignal = pskdemod(rxsig,2, ...
OutputType='bit', ...
NoiseVariance=1);
errStats = ber(data,int8(demodSignal));
%QPSK
noCoding = pskmod(data,4,InputType='bit');
rxNoCoding = awgn(noCoding,snr(ii));
rxBitsNoCoding = pskdemod(rxNoCoding,4,OutputType='bit');
errStatsNoCoding = ber2(data,int8(rxBitsNoCoding));
%OQPSK
noCoding2 = oqpskmod(data);
rxNoCoding2 = awgn(noCoding2,snr(ii));
rxBitsNoCoding2 = oqpskdemod(rxNoCoding2);
errStatsNoCoding2 = ber3(data,int8(rxBitsNoCoding2));
end
ber_grape(ii) = errStats(1,1);
ber_grape2(ii) = errStatsNoCoding(1,1);
ber_grape3(ii) = errStatsNoCoding2(1,1);
reset(ber);
reset(ber2);
reset(ber3);
end
semilogy(ebno, ber_grape, ...
ebno2, ber_grape2, ...
ebno3, ber_grape3)
xlim([0 inf])
ylim([10^-5 inf])
0 Kommentare
Antworten (1)
Gokul Nath S J
am 20 Apr. 2023
Hi Seongjong Kim,
Based on my understanding it seems that the BER for QPSK and OQPSK is showing a difference of 6 dB in the graph. As an alternative if you use the following code, the BER will come out almost similar values.
EbNo = (0:10)';
M = 4; % Modulation order
berQ = berawgn(EbNo,'psk',M,'nondiff');
berOQpsk = berawgn(EbNo,'oqpsk','nondiff');
You can also refer the following example to find more information on the computation,
For further information on the code, kindly refer the following link.
Thanks,
Gokul Nath S J
0 Kommentare
Siehe auch
Kategorien
Mehr zu Propagation and Channel Models finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!