Plot Bit error rate for DWT based OFDM

1 view (last 30 days)
Chaitanya
Chaitanya on 29 Jun 2014
Commented: André Marantes on 6 Nov 2022
I ve been trying to plot the Bit error rate vs Eb/No for DWT based ofdm but What i get is a straight line which of course means that the error rate does not change over the course of the signal strength which obviously should not be so.I am quiet sure I m wrong somewhere in the code. Here is the code snippet for IDWT at transmission side:
%%Setup
% Define parameters.
M = 4; % Size of signal constellation
k = log2(M); % Number of bits per symbol
n = 10000; % Number of bits to process
nsamp = 1; % Oversampling rate
nFFT = 64; % fft size
nDSC = 32; % number of data subcarriers
nQAMsymPerOFDMSym = 32; % number of QAM symboles per OFDM symbol (same as the number of subcarriers)
EbNo = [-3:20]; % multiple Eb/N0 values
for ii = 1:length(EbNo)
%%Signal Source
% Create a binary data stream as a column vector.
x = randint(nQAMsymPerOFDMSym*n,1); % Random binary data stream
%%Bit-to-Symbol Mapping
% Convert the bits in x into k-bit symbols.
xsym = bi2de(reshape(x,k,length(x)/k).','left-msb');
%%Modulation
% Modulate using 16-QAM.
y = modulate(modem.qammod(M),xsym);
xF = reshape(y,k,length(y)/k).';% grouping into multiple symbol
xF1=zeros(size(xF));
xt = (idwt(xF,xF1,'haar')).';
%%Transmitted Signal
%%Channel
% Send signal over an AWGN channel.
%%Received Signal
[yF1,yF2] =dwt(xt,'haar');
S=[yF1,yF2];
%%Demodulation
% Demodulate signal using 16-QAM.
zsym = demodulate(modem.qamdemod(M),S);
zsym1=zsym.';
%%Symbol-to-Bit Mapping
% Undo the bit-to-symbol mapping performed earlier.
z1 = de2bi(zsym1,'left-msb'); % Convert integers to bits.
% Convert z from a matrix to a vector.
z = reshape(z1.',prod(size(z1)),1);
%%BER Computation
% Compare x and z to obtain the number of errors and
% the bit error rate.
[number_of_errors(ii),bit_error_rate(ii)] = biterr(x,z);
end
theoryBer = (1/2)*erfc(sqrt(10.^(EbNo/10)));
close all; figure
semilogy(EbNo,theoryBer,'bs-','LineWidth',2);
hold on
semilogy(EbNo,bit_error_rate,'mx-','LineWidth',2);
axis([-3 15 10^-5 1])
grid on
legend('Theory', 'Simulation');
xlabel('Eb/No, dB')
ylabel('Bit Error Rate')
title('Bit error probability curve for M-QAM using DWT based OFDM system in AWGN channel')
Here is the O/P (which i think is wrong/unexpected):
I am so confused...Wonder where I m wrong.
  1 Comment
André Marantes
André Marantes on 6 Nov 2022
I am also trying to do OFDM with wavelet, can you explain what the modem means here?y = modulate(modem.qammod(M),xsym); and zsym = demodulate(modem.qamdemod(M),S);

Sign in to comment.

Answers (4)

Michael Martin
Michael Martin on 6 Jul 2014
I don't have the answer, but would like to try out your code. I may be able to figure it out. Can you share the entire M code with us please?
Mike
  4 Comments
ai sha
ai sha on 5 Sep 2016
hello.....i am also doing wavelet transform in OFDM. I make a ofdm and dwt-ofdm model in simulink. so pls send me a model at sofi2255@live.fr
Priyadharshini Arumugam
Priyadharshini Arumugam on 31 Oct 2020
Can you please send me a bit error matlab code for DFT based and wavelet based it will be very useful for me right now.. Kindly help me... Please mail to kavipriya031299@gmail.com

Sign in to comment.


Montadar Taher
Montadar Taher on 17 Jul 2017
First of all, you do not have the AWGN channel being used inside the loop, second, you have to prepare your data as yF1 only must be used for data recovery, where yF2 must be discarded.
  1 Comment
ABDUL
ABDUL on 16 Sep 2020
hello sir ... i am working on wavelet ofdm technique can you guide me how do i prepare the data for the recovery and how to discard the data which is not required at the receiver for the above code.

Sign in to comment.


ABDUL
ABDUL on 8 Sep 2020
hi....
i am working on Wavelets OFDM technique did you figure out the error in your code . if so can you share me the corrected code to me to my mail id abdul.abdulazeez@gmail.com. it will be of great help to me from your side.
Regards
Abdul Azeez

Wonjae Ryu
Wonjae Ryu on 22 Sep 2020
Regardless of the results, I'm curious about that this code works.
I'm also trying to implement wavelet-based OFDM in Matlab, however, IDWT doesn't work due to the reason of complex values.
The input cannot include complex values, therefore, my code doesn't work and only showed error message.
Is there any way to use idwt for modulated data including complex value???
  2 Comments
ABDUL
ABDUL on 22 Sep 2020
you can implement it by using the complex values too by taking the modulated signal and splitting it up the coefficients
deepa abraham
deepa abraham on 17 Aug 2021
I am also facing the same problem with idwt fucntion on complex values.
Do I need to separate the real and complex values of modulated symbols and and take idwt separately for these values?

Sign in to comment.

Categories

Find more on Discrete Multiresolution Analysis in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!