Time frequency training (TFT) OFDM

10 views (last 30 days)
Khushboo Singh
Khushboo Singh on 28 Dec 2012
Commented: sneha on 25 Sep 2019
Hello, I m writing a code for LDPC encoded TFT-OFDM technique. I want to plot SNR vs BER graph for this technique for snr = 14:0.5:17. my code is as follow. guys, i m totally stacked in this plzz plzz help me out. ref. D.linglong, Z.Wang and Z.Yang , “Time-Frequency Training OFDM with High Spectral Efficiency and Reliable Performance in High Speed Environments” IEEE JOURNAL ON SELECTED AREAS IN COMMUNICATIONS, VOL. 30, NO. 4, MAY 2012 clc; clear all; close all; format long;
SNR = linspace(14, 17, 7); %dB
% GENERATION OF INFORMATION AND LDPC ENCODING
I = randint(1,43200); % INFORMATION BITS
H = dvbs2ldpc(2/3);
l = fec.ldpcenc(H);
codeword = encode(l,I);
% BIT-INTERLEAVING
Order = (1:64800).';
hIntrlv = comm.BlockInterleaver(Order);
intrlvrOut = step(hIntrlv,codeword');
iout = intrlvrOut;
% 64-QAM MODULATION AND MAPPING
hmod =comm.RectangularQAMModulator(64,'BitInput',true);
moutp = step(hmod, iout);
mout = (moutp).';
x = 1;
for sym = 1:3 % SYMBOL LOOP
data = mout(x:x+3599);
new_sym = zeros(1,3660);
for i = 1:3600
new_sym(i+30) = data(i);
end
p_sym = zeros(1,3780);
d = sort(randint(1, 40, [2 3650])); % random index for central pilot
for i = 1:39
if (d(i+1) - d(i)) < 5
d(i+1) = d(i+1) + 1;
end
end
pilt = [-1 1 -1]; %BPSK modulated PILOT
for k = 1:40
g = d(k);
for i = 1:g-2;
p_sym(i) = new_sym(i);
end
for i = g-1:g+1
p_sym(g-1) = -1;
p_sym(g) = 1;
p_sym(g+1) = -1;
end
for i = g:3660
p_sym(i+2) = new_sym(i);
end
new_sym = p_sym;
end
new_sym = new_sym.'; % SERIAL TO PARALLEL
signal = ifft(new_sym, 3780); % 3780- point IFFT
signal = signal.'; % PARALLEL TO SERIAL
% Generating PN-Sequence
load pn_all.mat pn420;
PN420=transpose(pn420(1,:));
PN420_MC=sqrt(length(PN420)) * ifft(PN420);
TS = PN420_MC';
z = cxcorr(TS,TS); % For CIRCULAR CORRELATION THEOREM,
zz = circcorrcoef(TS,TS);
% Appending Training Sequence
Y = zeros(1,420);
for i = 1:420
Y(1,i) = TS(1,i);
end
t_signal = [Y signal]; % SIGNAL TO BE TRANSMITTED
% AWGN channel
for snr = 14 %:0.5:17 % SNR loop
pro = eye(4200)*t_signal';
r_signal = awgn(pro,snr).';
%TS-based path delay estimation
Tao = 1; %possible path
%Path coefficient estimation
for i = 1:3780;
r_block(i) = r_signal(420+i);
end
fft_r_block = fft(r_block.',3780);
for k = 1:40
for n = 0:3779
lem(k,n+1)= 1-(exp(-2j*pi*(n/3780))+exp(2j*pi*(n/3780)));
end
end
for n = 0:3779
thetha(n+1,1) = 1;
thetha(n+1,2) = n;
end
beta = lem*thetha;
for k = 1:40
y_p(k) = fft_r_block(d(k));
end
A = ((beta')*beta) + eye(2); %noise variance is assumed = 1
B = inv(A);
C = (beta') * (y_p.');
rho_cap = B * C;
h_inl = thetha * rho_cap;
g_i = sum(h_inl)/3780;
G_i = g_i * eye(3780);
%channel equalization: which is ONE-TAP-EQUALIZATION for AWGN channel
for k = 1:40
g = d(k);
for p_indx = 1:3
fft_r_block(g-1) = [];
end
end
data_block = zeros(3600,1);
for i = 1:30
data_block(i) = fft_r_block(i+30);
end
x_ik = data_block * ( conj(g_i) / ((abs(g_i)^2) + 1) );
end
for o = 1:3600
x_sym(o,sym) = x_ik(o);
end
end
stream = reshape(x_sym, 1, 10800);
hdmod =comm.RectangularQAMDemodulator(64,'BitOutput',true);
dout = step(hdmod, stream.');
dIntrlv = comm.BlockDeinterleaver(Order);
dintrd = step(dIntrlv,dout);
d = fec.ldpcdec(H);
final = decode(d,dintrd.');
be = xor(I,final);
  1 Comment
sneha
sneha on 25 Sep 2019
can i plz get code for dct based ofdm with index modulation

Sign in to comment.

Answers (2)

Hamada Esmaiel
Hamada Esmaiel on 7 Oct 2013
hi can i have pn_all.mat file

yjh kth
yjh kth on 9 Jan 2015
please, can I get matlab code for LDPC-OFDM

Products

Community Treasure Hunt

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

Start Hunting!