Problem with ber for ofdm system in matlab

Status
Not open for further replies.

vaibhav mishra

Newbie level 3
Joined
May 9, 2012
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,310
hello , i need help for my matlab program for calculating ber in ofdm..actually in my program i am got getting right curve for simulated data so plezz help me to knw where the problem is ..my progam is written below ...... plezz help me to get this done.

M=2;
N = 4;
G=N/4;
nsym = 2;
EbN0dB = [0:35];
EsN0dB = EbN0dB + 10*log10((N)/(N+G));
for ii = 1:length(EbN0dB)
data=randsrc(1,N*nsym,[0:M-1]);
psk_data=pskmod(data,M);
xF = reshape(psk_data,N,nsym).';
xt1 =ifft(xF.').';
xt = [xt1,[N-G+1:N]) xt1];
yt1 = sqrt(N+G/N)*xt;
yt = yt1,[G+1:N+G]);
yF = fft(yt.').';
yMod = reshape(yF.',N*nsym,1).';
psk_dataout=fft(yMod);
nErr(ii) = size(find(psk_dataout -data),2);
end
simBer = nErr/(nsym*N);
theoryBer = (1/2)*erfc(sqrt(10.^(EbN0dB/10)));
close all; figure
semilogy(EbN0dB,theoryBer,'bs-','LineWidth',2);
hold on
semilogy(EbN0dB,simBer,'mx-','LineWidth',2);
axis([0 10 10^-5 1])
grid on
 

Hi

Can you explain the signaifiance of variable "G" & "nsym=2". What it excatly represent and why you have used.
 

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