Hi i would like to ask how i reduce my ber value using FBMC modulation for my project the signal at receiver side is from oscillscope but ber is high . so can someone help me?

6 visualizzazioni (ultimi 30 giorni)
d = rng(211); % Set RNG state for repeatability
numFFT = 256; % Number of FFT points
numGuards = 53; % 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 num of bit in one symbol
bitsinreceiver = 6;
snrdB = 15; % 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);
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;
% Store transmitted signals for all symbols
currSym = complex(symBuf(1:KF));
txSigAll(:,symIdx) = currSym;
txrealsignal=real(txSigAll);
tximgsignal=imag(txSigAll);
% real and imaginarysignal
A=(23.95*real(txSigAll(:,12)));
B=(23.95*imag(txSigAll(:,12)));
C=[A B];
end
scopesignal = 'C:\Users\User\Desktop\4096_ij.csv';
T =readmatrix(scopesignal);
receivesignal=resample(T,2,8);
% Process symbol-wise
for symIdx = 1:numSymbols
rxSig = receivesignal;
% Add WGN
%rxNsig = awgn(rxSig, snrdB, 'measured');%%no need later
% 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;
% De-mapper: Perform hard decision
rxBits(:, symIdx) = qamdemod(rcomb, 2^bitsPerSubCarrier, ...
'OutputType', 'bit', 'UnitAveragePower', true);
end
% Measure BER with appropriate delay
BER = comm.ErrorRate;
BER.ReceiveDelay = bitsPerSubCarrier*KL;%1200 receivedelay
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(d);
%%%%%%%%%%%%%%%%%RESULT
%%FBMC Reception for K = 4, BER = 0.49167 at SNR = 15 dB
%%I WISH TO REDUCE BER VALUE THANK YOU

Risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by