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.

please check this code and give me the suggestion about this , this is OFDM TX

Status
Not open for further replies.

hakrajput

Newbie level 5
Joined
Aug 10, 2009
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,340
% No.of Carriers: 64
% Single frame size: 68 bits
% Total no. of Frames: 100
% Modulation: 16-QAM
% No. of Pilots: 4
% Cylic Extension: 25%(16)

close all
clear all
clc


%OFDM TRANSMISSION
%% Block 1 (SERIAL DATA SOURCE GENERATOR)

% Generating and coding data
t_data=randint(9600,1)';
x=1;
si=1; %for BER rows
FS=4096; %IFFT/FFT length
Kmax=1705; %number of subcarriers
Kmin=0;
%%
for d=1:100;
data=t_data(x:x+95);
x=x+68;
k=3;
n=6;
s1=size(data,2); % Size of input matrix
j=s1/k;
end %%(ye line mai ny dali hai)

%%
% Convolutionally encoding data
constlen=7;
codegen = [171 133]; % Polynomial
trellis = poly2trellis(constlen, codegen);
codedata = convenc(data, trellis);

%%
%Interleaving coded data

s2=size(codedata,2);
j=s2/4;
matrix=reshape(codedata,j,4);

intlvddata = matintrlv(matrix',2,2)'; % Interleave.
intlvddata=intlvddata';

%%
% Binary to decimal conversion

dec=bi2de(intlvddata','left-msb');


%%
%% 16 QAM MODULATION

M=16;
y = qammod(dec,M);
%Figure(1);

scatterplot(y) % malsa ho ga tou change kro ga
%plot(y);

%%
% Pilot insertion

lendata=length(y);
pilt=3+3j;
nofpits=4;

k=1;

for i=(1:13:52)

pilt_data1(i)=pilt;

for j=(i+1:i+12);
pilt_data1(j)=y(k);
k=k+1;
end
end


pilt_data1=pilt_data1'; % size of pilt_data =52
pilt_data(1:52)=pilt_data1(1:52); % upsizing to 64
pilt_data(13:64)=pilt_data1(1:52); % upsizing to 64

for i=1:52

pilt_data(i+6)=pilt_data1(i);

end

% Zero Pading
% edit yahan sy start kia hai dobara

N=Kmax+1;
a=-1+2*round(rand(N,1)).'+i*(-1+2*round(rand(N,1)).');
A=length(a);
info=zeros(FS,1);

info(1:(A/2))= [ a(1:(A/2)).'];
info((FS-((A/2)-1)):FS)= [ a(((A/2)+1):A).'];
carriers=FS.*ifft(info,FS);
%carriers=info:FS
%UPCONVERTER
L=length(carriers);
delay=64; % Reconstruction filter delay

%%
% IFFT
figure(2);
ifft_sig=ifft(pilt_data',64);
%time=(1:length(carriers))'/FS
time=(1:length(carriers))
plot(time,ifft_sig)



i failed to plot ifft , i received this message "vector must be of same length "
please tell me friend how to resolve this
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top