Help me understand OFDM pilot insertion code

Status
Not open for further replies.

er.deepshikha

Newbie level 6
Joined
Dec 2, 2011
Messages
12
Helped
5
Reputation
6
Reaction score
2
Trophy points
1,283
Activity points
1,349
pilot_ins_data=[zeros(nsym,6) par_data,[1:nbitpersym/2]) zeros(nsym,1) par_data,[nbitpersym/2+1:nbitpersym]) zeros(nsym,5)] ;

somebody please elaborate this part of ofdm code...this is the part of ofdm pilot insertion ....the whole code is as follows

close all
clear all
clc

nbitpersym = 52; % number of bits per OFDM symbol (same as the number of subcarriers for BPSK)
nsym = 10^4; % number of symbols
len_fft = 64; % fft size
sub_car = 52; % number of data subcarriers
EbNo = 0:2:12;

EsNo= EbNo + 10*log10(52/64)+ 10*log10(64/80); % symbol to noise ratio

snr=EsNo - 10*log10(52/64); % snr as to be used by awgn fn.

M = modem.pskmod(2); % modulation object

% Generating data

t_data=randint(nbitpersym*nsym,1);

% modulating data

mod_data = modulate(M,t_data);

% serial to parallel conversion

par_data = reshape(mod_data,nbitpersym,nsym).';

% pilot insertion

pilot_ins_data=[zeros(nsym,6) par_data,[1:nbitpersym/2]) zeros(nsym,1) par_data,[nbitpersym/2+1:nbitpersym]) zeros(nsym,5)] ;

% fourier transform time doamain data and normalizing the data

IFFT_data = (64/sqrt(52))*ifft(fftshift(pilot_ins_data.')).';

% addition cyclic prefix

cylic_add_data = [IFFT_data,[49:64]) IFFT_data].';

% parallel to serial coversion

ser_data = reshape(cylic_add_data,80*nsym,1);

% passing thru channel

no_of_error=[];
ratio=[];
for ii=1:length(snr)

chan_awgn = sqrt(80/52)*awgn(ser_data,snr(ii),'measured'); % awgn addition

ser_to_para = reshape(chan_awgn,80,nsym).'; % serial to parallel coversion

cyclic_pre_rem = ser_to_para,[17:80]); %cyclic prefix removal

FFT_recdata =(sqrt(52)/64)*fftshift(fft(cyclic_pre_rem.')).'; % freq domain transform

rem_pilot = FFT_recdata ,[6+[1:nbitpersym/2] 7+[nbitpersym/2+1:nbitpersym] ]); %pilot removal

ser_data_1 = reshape(rem_pilot.',nbitpersym*nsym,1); % serial coversion

z=modem.pskdemod(2); %demodulation object

demod_Data = demodulate(z,ser_data_1); %demodulating the data

[no_of_error(ii),ratio(ii)]=biterr(t_data,demod_Data) ; % error rate calculation

end

% plotting the result

semilogy(EbNo,ratio,'--or','linewidth',2);
hold on;
theoryBer = (1/2)*erfc(sqrt(10.^(EbNo/10)));
semilogy (EbNo,theoryBer,'--*b','linewidth',2);
grid on
axis([0 12 10^-5 .1])
xlabel('EbNo');
ylabel('BER')
title('Bit error probability curve for BPSK using OFDM');
....


I NEED THIS FOR MY PROJECT..PLZ HELP !!!
 

    V

    Points: 2
    Helpful Answer Positive Rating
Re: ofdm pilot insertion

The pilot insertion code that you mention is:
Code:
% pilot insertion

pilot_ins_data=[zeros(nsym,6) par_data(:,[1:nbitpersym/2]) zeros(nsym,1) par_data(:,[nbitpersym/2+1:nbitpersym]) zeros(nsym,5)] ;

Reason for pilot insertion:
Here the pilot process added is there to ensure correction of phase noise correction + frequency offset correction at the receiver.

Code:
Your adding the known pilot symbols to the data, I would suggest to have a look at the Matlab variable viewer to get a better perspective on it.

Note:
Normally you would want to simulate using a rayleigh multipath to get the effects of multipath in OFDM, which is one of its major advantages. Whereas I only see an AWGN.


Have fun
 

Re: ofdm pilot insertion

thanks fr ur repli..actully dis code isnt mine...m just tryng to understand it..i dwnloaded it frm d net....il keep ur advice in mind..once again thnx fr repling n HAPPY NEW YEAR 2012
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…