Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Plotting OFDM BER versus Eb/No

Status
Not open for further replies.

grozdov

Newbie level 2
Joined
Feb 6, 2008
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,318
ofdm ber

Hello;
I am new in MATLAB, I got this MATLAB code from one book... I want to plot BER versus Eb/No... can someone help me in this?
Thanks

% ****** This is a simultion to realize OFDM transmission

para = 128; % No. of parallel channels
fftlen = 128; % FFT length
noc = 128; % No. of carriers
nd = 6; % No. of information OFDM symbol for one loop
ml = 2; % Modulation level
sr = 250000 % Symbol rate
br = sr*ml % Bit rate per carrier
gilen = 32; % Length of guard interval points
ebno = 1:5; % Eb/No try also 100

% ****** main loop *************************

nloop = 100; % No. of simulation loops
noe = 0; % No. of error data
nod = 0; % No. No. of transmitted data
eop = 0; % No. of error packets
nop = 0; % NO. of transmitted packets

for i = 1:nloop
% **********Transmitter
% Data generator
for k = 1:length(ebno)
seldata = rand(1,para*nd*ml)>0.5;
% Serial to parralel conversion
paradata = reshape(seldata,para,nd*ml);

%QPSK modulation
[ich,qch] = qpskmod(paradata,para,nd,ml);

% The I and Q data are increased kmod times to normalize the data
kmod = 1/sqrt(2);
ich1 = ich.*kmod;
qch1 = qch.*kmod;

% IFFT
x = ich1+qch1.*i; % Parellel are converted to serial
y = ifft(x);
ich2 = real(y);
qch2 = imag(y);

% Guard interval insertion
[ich3,qch3] = giins(ich2,qch2,fftlen,gilen,nd);
fftlen2 = fftlen + gilen

% Attenuation
spow = sum(ich3.^2 + qch3.^2)/nd./para;
attn = 0.5*spow*sr/br*10.^(-ebno/10);
attn = sqrt(attn);

% Receiver plus noise
[ich4,qch4] = comb(ich3,qch3,attn(k));

% Guard removal
[ich5,qch5] = girem(ich4,qch4,fftlen2,gilen,nd);

% FFT

rx = ich5 + qch.*i;
ry = fft(rx);
ich6 = real(ry);
qch6 = imag(ry);

% Demodulation
ich7 = ich6./kmod;
qch7 = qch6./kmod;
[demodata] = qpskdemod(ich7,qch7,para,nd,ml);

% Parallel to serial conversion
demodata1 = reshape(demodata,1,para*nd*ml);

% BER calculations
noe2(k) = sum(abs(demodata1-seldata));
nod2(k) = length(seldata);

% Cummulative the no. of errors and data in noe and nod
noe = noe(k) + noe2;
nod = nod (k)+ nod2;


% Calculating PER
if noe2 ~=0;
eop = eop
end
nop = nop + 1;
ber = noe/nod
per = eop/nop;
ber(k) = noe/nod
end

end

% *********** Output results
 

ber ofdm

can you explain where exactly you need help? I think I saw this code. you have to get BER result. and then plot against the values corresponding to those.
 

if someone can xplain me the above code at following lines like (COMB is not clear, giin guard interval , girem, gaurd interval removal)
 

Re: ofdm ber

grozdov said:
Hello;
I am new in MATLAB, I got this MATLAB code from one book... I want to plot BER versus Eb/No... can someone help me in this?
Thanks

% ****** This is a simultion to realize OFDM transmission

para = 128; % No. of parallel channels
fftlen = 128; % FFT length
noc = 128; % No. of carriers
nd = 6; % No. of information OFDM symbol for one loop
ml = 2; % Modulation level
sr = 250000 % Symbol rate
br = sr*ml % Bit rate per carrier
gilen = 32; % Length of guard interval points
ebno = 1:5; .........................................................................
.......................................................................
.......................................................
.................................................
end

end

% *********** Output results


would you tell me what is the name of this book?

thanks
 

i have never seen a book give a complete code for ofdm such that

would you tell me the name of the book?
 

i have also gone through the same code and its from some thesis ..can u help me in defining the functions like COMB which i myself is unable to find on matlab. seecond one is about GAURD INTERVAL , i cant get the idea how to insert the gaurd interval and remove it
thanks

Added after 1 minutes:

@ aya can u help me in xilinx system generator
 

Hi All,

I guess this file is downloaded from the following website:

www.pudn.com

it's written in some book, any way the comp function is the function which are responsible to add the effect of the channel to the transmitted signal.

since currntly I don't have my labtop, next time I will try to upload all the files here

Best Regards
 

this code is not complete, alot of functions is not matlab functions like the guard interval insertiona nd removal they are user define.
and this code using (qpskmod) without define the modualtion try help (modem) in matlab help u will find modualtion type.
the way for calcualte BER is not effecient using BER command is more accurate.
finally this code is not complete when u download it u get .rar file it has all the user define codes.
 

The book name is" Simulation and Software radio for Mobile Communications". You need to have all matlab codes from the book, otherwise you can not run the simulation.
Lenin
 

If this is code uses built-in functions only, then
semilogy(ebno, ber);
grid on;

If the code uses other functions (I see qpskmod) then you have to get other m-files from same book or implement the functions with the same names.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top