Error in FBMC vs. OFDM Modulation of Mathworks

12 views (last 30 days)
In this code, having a transmission without noise, the transmitted bits should be the same as the received bits.
The inpData variable is different than the rxBits variable. Example: inpData [1 0 1 1] .... rxBits [0 0 1 0]. Please help
s = rng(211); % Set RNG state for repeatability
%%System Parameters
numFFT = 1024; % Number of FFT points
numGuards = 212; % Guard bands on both sides
K = 4; % Overlapping symbols, one of 2, 3, or 4
numSymbols = 8; % Simulation length in symbols
bitsPerSubCarrier = 4; % 2: 4QAM, 4: 16QAM, 6: 64QAM, 8: 256QAM
snrdB =0; % SNR in dB
% Prototype filter
switch K
case 2
HkOneSided = sqrt(2)/2;
case 3
HkOneSided = [0.911438 0.411438];
case 4
HkOneSided = [0.971960 sqrt(2)/2 0.235147];
otherwise
return
end
% Build symmetric filter
Hk = [fliplr(HkOneSided) 1 HkOneSided];
% QAM symbol mapper
qamMapper = comm.RectangularQAMModulator(...
'ModulationOrder', 2^bitsPerSubCarrier, ...
'BitInput', true, ...
'NormalizationMethod', 'Average power');
% Transmit-end processing
% Initialize arrays
L = numFFT-2*numGuards; % Number of complex symbols per OFDM symbol
KF = K*numFFT;
KL = K*L;
dataSubCar = zeros(L, 1);
dataSubCarUp = zeros(KL, 1);
sumFBMCSpec = zeros(KF*2, 1);
sumOFDMSpec = zeros(numFFT*2, 1);
numBits = bitsPerSubCarrier*L/2; % account for oversampling by 2
inpData = zeros(numBits, numSymbols);
rxBits = zeros(numBits, numSymbols);
txSigAll = complex(zeros(KF, numSymbols));
symBuf = complex(zeros(2*KF, 1));
% Loop over symbols
for symIdx = 1:numSymbols
% Generate mapped symbol data
inpData(:, symIdx) = randi([0 1], numBits, 1);
modData = qamMapper(inpData(:, symIdx));
% OQAM Modulator: alternate real and imaginary parts
if rem(symIdx,2)==1 % Odd symbols
dataSubCar(1:2:L) = real(modData);
dataSubCar(2:2:L) = 1i*imag(modData);
else % Even symbols
dataSubCar(1:2:L) = 1i*imag(modData);
dataSubCar(2:2:L) = real(modData);
end
% Upsample by K, pad with guards, and filter with the prototype filter
dataSubCarUp(1:K:end) = dataSubCar;
dataBitsUpPad = [zeros(numGuards*K,1); dataSubCarUp; zeros(numGuards*K,1)];
X1 = filter(Hk, 1, dataBitsUpPad);
% Remove 1/2 filter length delay
X = [X1(K:end); zeros(K-1,1)];
% Compute IFFT of length KF for the transmitted symbol
txSymb = fftshift(ifft(X));
% Transmitted signal is a sum of the delayed real, imag symbols
symBuf = [symBuf(numFFT/2+1:end); complex(zeros(numFFT/2,1))];
symBuf(KF+(1:KF)) = symBuf(KF+(1:KF)) + txSymb;
% Compute power spectral density (PSD)
currSym = complex(symBuf(1:KF));
[specFBMC, fFBMC] = periodogram(currSym, hann(KF, 'periodic'), KF*2, 1);
sumFBMCSpec = sumFBMCSpec + specFBMC;
% Store transmitted signals for all symbols
txSigAll(:,symIdx) = currSym;
end
% Plot power spectral density
sumFBMCSpec = sumFBMCSpec/mean(sumFBMCSpec(1+K+2*numGuards*K:end-2*numGuards*K-K));
plot(fFBMC-0.5,10*log10(sumFBMCSpec));
grid on
axis([-0.5 0.5 -180 10]);
xlabel('Normalized frequency');
ylabel('PSD (dBW/Hz)')
title(['FBMC, K = ' num2str(K) ' overlapped symbols'])
set(gcf, 'Position', figposition([15 50 30 30]));
for symIdx = 1:numSymbols
inpData2 = randi([0 1], bitsPerSubCarrier*L, 1);
modData = qamMapper(inpData2);
symOFDM = [zeros(numGuards,1); modData; zeros(numGuards,1)];
ifftOut = sqrt(numFFT).*ifft(ifftshift(symOFDM));
[specOFDM,fOFDM] = periodogram(ifftOut, rectwin(length(ifftOut)), ...
numFFT*2, 1, 'centered');
sumOFDMSpec = sumOFDMSpec + specOFDM;
end
% Plot power spectral density (PSD) over all subcarriers
sumOFDMSpec = sumOFDMSpec/mean(sumOFDMSpec(1+2*numGuards:end-2*numGuards));
figure;
plot(fOFDM,10*log10(sumOFDMSpec));
grid on
axis([-0.5 0.5 -180 10]);
xlabel('Normalized frequency');
ylabel('PSD (dBW/Hz)')
title(['OFDM, numFFT = ' num2str(numFFT)])
set(gcf, 'Position', figposition([46 50 30 30]));
% QAM demodulator
qamDemod = comm.RectangularQAMDemodulator(...
'ModulationOrder', 2^bitsPerSubCarrier, ...
'BitOutput', true, ...
'NormalizationMethod', 'Average power');
BER = comm.ErrorRate;
% Process symbol-wise
for symIdx = 1:numSymbols
rxSig = txSigAll(:, symIdx);
% Add WGN
%rxNsig = awgn(rxSig, snrdB, 'measured');
% Perform FFT
rxf = fft(fftshift(rxSig));
% Matched filtering with prototype filter
rxfmf = filter(Hk, 1, rxf);
% Remove K-1 delay elements
rxfmf = [rxfmf(K:end); zeros(K-1,1)];
% Remove guards
rxfmfg = rxfmf(numGuards*K+1:end-numGuards*K);
% OQAM post-processing
% Downsample by 2K, extract real and imaginary parts
if rem(symIdx, 2)
% Imaginary part is K samples after real one
r1 = real(rxfmfg(1:2*K:end));
r2 = imag(rxfmfg(K+1:2*K:end));
rcomb = complex(r1, r2);
else
% Real part is K samples after imaginary one
r1 = imag(rxfmfg(1:2*K:end));
r2 = real(rxfmfg(K+1:2*K:end));
rcomb = complex(r2, r1);
end
% Normalize by the upsampling factor
rcomb = (1/K)*rcomb;
% Demapper: Perform hard decision
rxBits(:, symIdx) = qamDemod(rcomb);
end
% Measure BER with appropriate delay
BER.ReceiveDelay = bitsPerSubCarrier*KL;
ber = BER(inpData(:), rxBits(:));
% Display Bit error
disp(['FBMC Reception for K = ' num2str(K) ', BER = ' num2str(ber(1)) ...
' at SNR = ' num2str(snrdB) ' dB'])
% Restore RNG state
rng(s);

Answers (4)

mohamed elganiny
mohamed elganiny on 15 Jul 2021
Dear / Aaron Hughes
please, i want to know the purpose of the following two line in this code and briefly how these two lines work
i know that is related to sum and overlap block as mentioned in the code description but Unfortunately it is not clear for me to understand.
% Transmitted signal is a sum of the delayed real, imag symbols
symBuf = [symBuf(numFFT/2+1:end); complex(zeros(numFFT/2,1))];
symBuf(KF+(1:KF)) = symBuf(KF+(1:KF)) + txSymb;
thanks in advance

abdullah qasim
abdullah qasim on 16 Jan 2019
this code calculates BER for one sample, not for all samples so give one value for BER.
so we must do it loop (for loop) to calculate all values of ber and give the full sketch to BER to SNR
  1 Comment
Peter Liu
Peter Liu on 22 Mar 2019
Hi. Do you know why it measures BER with the delay bitsPerSubCarrier*KL ? Does it mean that all the recieved data lags behind the transmitted data by bitsPerSubCarrier*KL samples?

Sign in to comment.


Aaron Hughes
Aaron Hughes on 20 Dec 2020
The "magic" of this code happens here
% Measure BER with appropriate delay <-- notice it says with appropriate "delay"
%BER.ReceiveDelay = bitsPerSubCarrier*KL; <-- if you comment out this line
like I did here, you'll get
the behavior you're reporting
ber = BER(inpData(:), rxBits(:)); ß this will report nearly 50% error rate
Because you are doing this
sum( rxBits(:,symIdx) ~= inpData(:,symIdx) )
But the way FBMC works, is there’s a delay due to the overlapping of symbols.
BER.ReceiveDelay = bitsPerSubCarrier*KL; ß That’s why there’s this
ber = BER(inpData(:), rxBits(:)); ß This will now report 0 errors
For example, if BER.ReceiveDelay=4800 and you’re sending 600 bits each symbol, then this is a delay of 4800/600 = 8 symbols.
This means you need to compare this
sum( rxBits(:,symIdx) ~= inpData(:,symIdx-8) )
And I’ve verified the code works!
===========================================================================
This code below will have the ERRORS you reported using the code above I just explained,
AND comm.ErrorRate will report this too
s = rng(211); % Set RNG state for repeatability
numFFT = 1024; % Number of FFT points
numGuards = 212; % Guard bands on both sides
K = 4; % Overlapping symbols, one of 2, 3, or 4
numSymbols = 100; % Simulation length in symbols
bitsPerSubCarrier = 2; % 2: 4QAM, 4: 16QAM, 6: 64QAM, 8: 256QAM
snrdB = 45; % SNR in dB
% Prototype filter
switch K
case 2
HkOneSided = sqrt(2)/2;
case 3
HkOneSided = [0.911438 0.411438];
case 4
HkOneSided = [0.971960 sqrt(2)/2 0.235147];
otherwise
return
end
% Build symmetric filter
Hk = [fliplr(HkOneSided) 1 HkOneSided];
% Transmit-end processing
% Initialize arrays
L = numFFT-2*numGuards; % Number of complex symbols per OFDM symbol
KF = K*numFFT;
KL = K*L;
dataSubCar = zeros(L, 1);
dataSubCarUp = zeros(KL, 1);
sumFBMCSpec = zeros(KF*2, 1);
sumOFDMSpec = zeros(numFFT*2, 1);
numBits = bitsPerSubCarrier*L/2; % account for oversampling by 2
inpData = zeros(numBits, numSymbols);
rxBits = zeros(numBits, numSymbols);
txSigAll = complex(zeros(KF, numSymbols));
symBuf = complex(zeros(2*KF, 1));
% Loop over symbols
for symIdx = 1:numSymbols
% Generate mapped symbol data
inpData(:, symIdx) = randi([0 1], numBits, 1);
modData = qammod(inpData(:, symIdx), 2^bitsPerSubCarrier, ...
'InputType', 'Bit', 'UnitAveragePower', true);
% OQAM Modulator: alternate real and imaginary parts
if rem(symIdx,2)==1 % Odd symbols
dataSubCar(1:2:L) = real(modData);
dataSubCar(2:2:L) = 1i*imag(modData);
else % Even symbols
dataSubCar(1:2:L) = 1i*imag(modData);
dataSubCar(2:2:L) = real(modData);
end
% Upsample by K, pad with guards, and filter with the prototype filter
dataSubCarUp(1:K:end) = dataSubCar;
dataBitsUpPad = [zeros(numGuards*K,1); dataSubCarUp; zeros(numGuards*K,1)];
X1 = filter(Hk, 1, dataBitsUpPad);
% Remove 1/2 filter length delay
X = [X1(K:end); zeros(K-1,1)];
% Compute IFFT of length KF for the transmitted symbol
txSymb = fftshift(ifft(X));
% Transmitted signal is a sum of the delayed real, imag symbols
symBuf = [symBuf(numFFT/2+1:end); complex(zeros(numFFT/2,1))];
symBuf(KF+(1:KF)) = symBuf(KF+(1:KF)) + txSymb;
% Compute power spectral density (PSD)
currSym = complex(symBuf(1:KF));
[specFBMC, fFBMC] = periodogram(currSym, hann(KF, 'periodic'), KF*2, 1);
sumFBMCSpec = sumFBMCSpec + specFBMC;
% Store transmitted signals for all symbols
txSigAll(:,symIdx) = currSym;
end
% Plot power spectral density
sumFBMCSpec = sumFBMCSpec/mean(sumFBMCSpec(1+K+2*numGuards*K:end-2*numGuards*K-K));
plot(fFBMC-0.5,10*log10(sumFBMCSpec));
grid on
axis([-0.5 0.5 -180 10]);
xlabel('Normalized frequency');
ylabel('PSD (dBW/Hz)')
title(['FBMC, K = ' num2str(K) ' overlapped symbols'])
set(gcf, 'Position', figposition([15 50 30 30]));
for symIdx = 1:numSymbols
inpData2 = randi([0 1], bitsPerSubCarrier*L, 1);
modData = qammod(inpData2, 2^bitsPerSubCarrier, ...
'InputType', 'Bit', 'UnitAveragePower', true);
symOFDM = [zeros(numGuards,1); modData; zeros(numGuards,1)];
ifftOut = sqrt(numFFT).*ifft(ifftshift(symOFDM));
[specOFDM,fOFDM] = periodogram(ifftOut, rectwin(length(ifftOut)), ...
numFFT*2, 1, 'centered');
sumOFDMSpec = sumOFDMSpec + specOFDM;
end
% Plot power spectral density (PSD) over all subcarriers
sumOFDMSpec = sumOFDMSpec/mean(sumOFDMSpec(1+2*numGuards:end-2*numGuards));
figure;
plot(fOFDM,10*log10(sumOFDMSpec));
grid on
axis([-0.5 0.5 -180 10]);
xlabel('Normalized frequency');
ylabel('PSD (dBW/Hz)')
title(['OFDM, numFFT = ' num2str(numFFT)])
set(gcf, 'Position', figposition([46 50 30 30]));
BER = comm.ErrorRate;
TotalBitsInError = 0;
TotalBits = 0;
% Process symbol-wise
for symIdx = 1:numSymbols
rxSig = txSigAll(:, symIdx);
% Add WGN
rxNsig = awgn(rxSig, snrdB, 'measured');
% Perform FFT
rxf = fft(fftshift(rxNsig));
% Matched filtering with prototype filter
rxfmf = filter(Hk, 1, rxf);
% Remove K-1 delay elements
rxfmf = [rxfmf(K:end); zeros(K-1,1)];
% Remove guards
rxfmfg = rxfmf(numGuards*K+1:end-numGuards*K);
% OQAM post-processing
% Downsample by 2K, extract real and imaginary parts
if rem(symIdx, 2)
% Imaginary part is K samples after real one
r1 = real(rxfmfg(1:2*K:end));
r2 = imag(rxfmfg(K+1:2*K:end));
rcomb = complex(r1, r2);
else
% Real part is K samples after imaginary one
r1 = imag(rxfmfg(1:2*K:end));
r2 = real(rxfmfg(K+1:2*K:end));
rcomb = complex(r2, r1);
end
% Normalize by the upsampling factor
rcomb = (1/K)*rcomb;
% De-mapper: Perform hard decision
rxBits(:, symIdx) = qamdemod(rcomb, 2^bitsPerSubCarrier, ...
'OutputType', 'bit', 'UnitAveragePower', true);
NumBitsInError = sum( rxBits(:,symIdx) ~= inpData(:,symIdx) );
fprintf('symIdx=%3d had %3d bits in error out of %d bits which is %.2f%% error rate\n',symIdx,NumBitsInError,length(inpData(:,symIdx)),100*NumBitsInError/length(inpData(:,symIdx)));
symIdx = symIdx;
TotalBitsInError = TotalBitsInError + NumBitsInError;
TotalBits = TotalBits + length(inpData(:,symIdx));
end
% Measure BER with appropriate delay
%BER.ReceiveDelay = bitsPerSubCarrier*KL;
ber = BER(inpData(:), rxBits(:));
% Display Bit error
disp(['FBMC Reception for K = ' num2str(K) ', BER = ' num2str(ber(1)) ...
' at SNR = ' num2str(snrdB) ' dB'])
fprintf('Total Bits in error is %d out of %d bits, BER=%.2f%%\n',ber(2),ber(3),100*ber(2)/ber(3));
fprintf('Total Bits in error is %d out of %d bits, BER=%.2f%%\n',TotalBitsInError,TotalBits,100*TotalBitsInError/TotalBits);
% Restore RNG state
rng(s);
Output looks like this
symIdx= 94 had 293 bits in error out of 600 bits which is 48.83% error rate
symIdx= 95 had 309 bits in error out of 600 bits which is 51.50% error rate
symIdx= 96 had 310 bits in error out of 600 bits which is 51.67% error rate
symIdx= 97 had 307 bits in error out of 600 bits which is 51.17% error rate
symIdx= 98 had 310 bits in error out of 600 bits which is 51.67% error rate
symIdx= 99 had 301 bits in error out of 600 bits which is 50.17% error rate
symIdx=100 had 310 bits in error out of 600 bits which is 51.67% error rate
FBMC Reception for K = 4, BER = 0.49973 at SNR = 45 dB
Total Bits in error is 29984 out of 60000 bits, BER=49.97%
Total Bits in error is 29984 out of 60000 bits, BER=49.97%
===========================================================================
This code below will NOT have the errors you reported because I’m incorporating the delay
s = rng(211); % Set RNG state for repeatability
numFFT = 1024; % Number of FFT points
numGuards = 212; % Guard bands on both sides
K = 4; % Overlapping symbols, one of 2, 3, or 4
numSymbols = 100; % Simulation length in symbols
bitsPerSubCarrier = 2; % 2: 4QAM, 4: 16QAM, 6: 64QAM, 8: 256QAM
snrdB = 45; % SNR in dB
% Prototype filter
switch K
case 2
HkOneSided = sqrt(2)/2;
case 3
HkOneSided = [0.911438 0.411438];
case 4
HkOneSided = [0.971960 sqrt(2)/2 0.235147];
otherwise
return
end
% Build symmetric filter
Hk = [fliplr(HkOneSided) 1 HkOneSided];
% Transmit-end processing
% Initialize arrays
L = numFFT-2*numGuards; % Number of complex symbols per OFDM symbol
KF = K*numFFT;
KL = K*L;
dataSubCar = zeros(L, 1);
dataSubCarUp = zeros(KL, 1);
sumFBMCSpec = zeros(KF*2, 1);
sumOFDMSpec = zeros(numFFT*2, 1);
numBits = bitsPerSubCarrier*L/2; % account for oversampling by 2
inpData = zeros(numBits, numSymbols);
rxBits = zeros(numBits, numSymbols);
txSigAll = complex(zeros(KF, numSymbols));
symBuf = complex(zeros(2*KF, 1));
% Loop over symbols
for symIdx = 1:numSymbols
% Generate mapped symbol data
inpData(:, symIdx) = randi([0 1], numBits, 1);
modData = qammod(inpData(:, symIdx), 2^bitsPerSubCarrier, ...
'InputType', 'Bit', 'UnitAveragePower', true);
% OQAM Modulator: alternate real and imaginary parts
ifrem(symIdx,2)==1 % Odd symbols
dataSubCar(1:2:L) = real(modData);
dataSubCar(2:2:L) = 1i*imag(modData);
else % Even symbols
dataSubCar(1:2:L) = 1i*imag(modData);
dataSubCar(2:2:L) = real(modData);
end
% Upsample by K, pad with guards, and filter with the prototype filter
dataSubCarUp(1:K:end) = dataSubCar;
dataBitsUpPad = [zeros(numGuards*K,1); dataSubCarUp; zeros(numGuards*K,1)];
X1 = filter(Hk, 1, dataBitsUpPad);
% Remove 1/2 filter length delay
X = [X1(K:end); zeros(K-1,1)];
% Compute IFFT of length KF for the transmitted symbol
txSymb = fftshift(ifft(X));
% Transmitted signal is a sum of the delayed real, imag symbols
symBuf = [symBuf(numFFT/2+1:end); complex(zeros(numFFT/2,1))];
symBuf(KF+(1:KF)) = symBuf(KF+(1:KF)) + txSymb;
% Compute power spectral density (PSD)
currSym = complex(symBuf(1:KF));
[specFBMC, fFBMC] = periodogram(currSym, hann(KF, 'periodic'), KF*2, 1);
sumFBMCSpec = sumFBMCSpec + specFBMC;
% Store transmitted signals for all symbols
txSigAll(:,symIdx) = currSym;
end
% Plot power spectral density
sumFBMCSpec = sumFBMCSpec/mean(sumFBMCSpec(1+K+2*numGuards*K:end-2*numGuards*K-K));
plot(fFBMC-0.5,10*log10(sumFBMCSpec));
grid on
axis([-0.5 0.5 -180 10]);
xlabel('Normalized frequency');
ylabel('PSD (dBW/Hz)')
title(['FBMC, K = ' num2str(K) ' overlapped symbols'])
set(gcf, 'Position', figposition([15 50 30 30]));
for symIdx = 1:numSymbols
inpData2 = randi([0 1], bitsPerSubCarrier*L, 1);
modData = qammod(inpData2, 2^bitsPerSubCarrier, ...
'InputType', 'Bit', 'UnitAveragePower', true);
symOFDM = [zeros(numGuards,1); modData; zeros(numGuards,1)];
ifftOut = sqrt(numFFT).*ifft(ifftshift(symOFDM));
[specOFDM,fOFDM] = periodogram(ifftOut, rectwin(length(ifftOut)), ...
numFFT*2, 1, 'centered');
sumOFDMSpec = sumOFDMSpec + specOFDM;
end
% Plot power spectral density (PSD) over all subcarriers
sumOFDMSpec = sumOFDMSpec/mean(sumOFDMSpec(1+2*numGuards:end-2*numGuards));
figure;
plot(fOFDM,10*log10(sumOFDMSpec));
grid on
axis([-0.5 0.5 -180 10]);
xlabel('Normalized frequency');
ylabel('PSD (dBW/Hz)')
title(['OFDM, numFFT = ' num2str(numFFT)])
set(gcf, 'Position', figposition([46 50 30 30]));
BER = comm.ErrorRate;
TotalBitsInError = 0;
TotalBits = 0;
% Process symbol-wise
for symIdx = 1:numSymbols
rxSig = txSigAll(:, symIdx);
% Add WGN
rxNsig = awgn(rxSig, snrdB, 'measured');
% Perform FFT
rxf = fft(fftshift(rxNsig));
% Matched filtering with prototype filter
rxfmf = filter(Hk, 1, rxf);
% Remove K-1 delay elements
rxfmf = [rxfmf(K:end); zeros(K-1,1)];
% Remove guards
rxfmfg = rxfmf(numGuards*K+1:end-numGuards*K);
% OQAM post-processing
% Downsample by 2K, extract real and imaginary parts
if rem(symIdx, 2)
% Imaginary part is K samples after real one
r1 = real(rxfmfg(1:2*K:end));
r2 = imag(rxfmfg(K+1:2*K:end));
rcomb = complex(r1, r2);
else
% Real part is K samples after imaginary one
r1 = imag(rxfmfg(1:2*K:end));
r2 = real(rxfmfg(K+1:2*K:end));
rcomb = complex(r2, r1);
end
% Normalize by the upsampling factor
rcomb = (1/K)*rcomb;
% De-mapper: Perform hard decision
rxBits(:, symIdx) = qamdemod(rcomb, 2^bitsPerSubCarrier, ...
'OutputType', 'bit', 'UnitAveragePower', true);
if symIdx>8
NumBitsInError = sum( rxBits(:,symIdx) ~= inpData(:,symIdx-8) );
fprintf('symIdx=%3d had %3d bits in error out of %d bits which is %.2f%% error rate\n',symIdx,NumBitsInError,length(inpData(:,symIdx)),100*NumBitsInError/length(inpData(:,symIdx)));
TotalBitsInError = TotalBitsInError + NumBitsInError;
TotalBits = TotalBits + length(inpData(:,symIdx));
end
symIdx = symIdx;
end
% Measure BER with appropriate delay
BER.ReceiveDelay = bitsPerSubCarrier*KL;
ber = BER(inpData(:), rxBits(:));
% Display Bit error
disp(['FBMC Reception for K = ' num2str(K) ', BER = ' num2str(ber(1)) ...
' at SNR = ' num2str(snrdB) ' dB'])
fprintf('Total Bits in error is %d out of %d bits, BER=%.2f%%\n',ber(2),ber(3),100*ber(2)/ber(3));
fprintf('Total Bits in error is %d out of %d bits, BER=%.2f%%\n',TotalBitsInError,TotalBits,100*TotalBitsInError/TotalBits);
% Restore RNG state
rng(s);
Output looks like this
symIdx= 94 had 0 bits in error out of 600 bits which is 0.00% error rate
symIdx= 95 had 0 bits in error out of 600 bits which is 0.00% error rate
symIdx= 96 had 0 bits in error out of 600 bits which is 0.00% error rate
symIdx= 97 had 0 bits in error out of 600 bits which is 0.00% error rate
symIdx= 98 had 0 bits in error out of 600 bits which is 0.00% error rate
symIdx= 99 had 0 bits in error out of 600 bits which is 0.00% error rate
symIdx=100 had 0 bits in error out of 600 bits which is 0.00% error rate
FBMC Reception for K = 4, BER = 0 at SNR = 45 dB
Total Bits in error is 0 out of 55200 bits, BER=0.00%
Total Bits in error is 0 out of 55200 bits, BER=0.00%

Aaron Hughes
Aaron Hughes on 20 Dec 2020
Sorry I don't understand your question.
But please notice there are 2 versions of the code I added above.
Version 1 will have an output like this
symIdx= 99 had 301 bits in error out of 600 bits which is 50.17% error rate
symIdx=100 had 310 bits in error out of 600 bits which is 51.67% error rate
FBMC Reception for K = 4, BER = 0.49973 at SNR = 45 dB
Total Bits in error is 29984 out of 60000 bits, BER=49.97%
Total Bits in error is 29984 out of 60000 bits, BER=49.97%
Version 2 will have an output like this
symIdx= 99 had 0 bits in error out of 600 bits which is 0.00% error rate
symIdx=100 had 0 bits in error out of 600 bits which is 0.00% error rate
FBMC Reception for K = 4, BER = 0 at SNR = 45 dB
Total Bits in error is 0 out of 55200 bits, BER=0.00%
Total Bits in error is 0 out of 55200 bits, BER=0.00%
Also I do see a syntax error in the code I added.
Looks like the rich text editor removed a space on me.
ifrem(symIdx,2)==1 % Odd symbols
should be
if rem(symIdx,2)==1 % Odd symbols
  3 Comments
Aaron Hughes
Aaron Hughes on 21 Dec 2020
The first version BER is not supposed to reach zero.
The first version is showing what happens if you don't take the delay into account, which is you get a BER of 50%.
The second version does take the delay into account, and you get a BER of 0%.
In this FBMC example, there are K=4 symbols overlapped which amounts to a processing delay of 2*K=8 symbol delay at the receiver.
NumBitsInError = sum( rxBits(:,symIdx) ~= inpData(:,symIdx-0) ); <-- Version 1 delay=0
NumBitsInError = sum( rxBits(:,symIdx) ~= inpData(:,symIdx-8) ); <-- Version 2 delay=8
kim zheng cho
kim zheng cho on 4 Dec 2022
Hi, i would like to ask if let said i want to process more than one symbol how should i modified the code?Since 1 symbol is 4096 point if let said i want to process two symbol in column which 8192 point/data bits how should i done it? As the left side must equal to right side . Thank you.....

Sign in to comment.

Categories

Find more on UMTS Test and Measurement in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!