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.

BPSK BER with OFDM in MATLAB

Status
Not open for further replies.

hungeric

Newbie level 2
Joined
Nov 3, 2010
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,301
Hello, I have some problems about plotting BPSK BER versus Eb/No with OFDM modulation.
I have written a program shown below but it doesn't work. Can anyone help me please?

clear;

fc = 1; % Carrier frequency
carrier = 4000; % Number of carrier
Ts = 1/10; % Sampling time
t = [0:Ts:(1-Ts)]; % Time vector
fs = 1/Ts; % Sampling frequency
Eb_No = [0:1:10]; %in dB
error = 0;


for i = 1:1:length(Eb_No)

%=====Transmitter=====
s = rand(1,carrier) > 0.5; %random 1's and 0's
st = 2*s-1; % BPSK modulation 0 --> -1, 1 --> +1
st = st';

FFT = carrier/sqrt(carrier)*fft(st);
%==========Adding Noise=========
var(i) =0.5*10^(-Eb_No(i)/10); % variance
nt = 1/sqrt(2)*[randn(1,carrier) + j*randn(1,carrier)]; %gaussian noise

AWGN =var(i)*nt; %Noise = variance x gaussian noise


FFT_noise = FFT' + AWGN;
FFT_noise =sqrt(carrier)/carrier*ifft(FFT_noise);

error(i)=0;
%Comparision
y = 2*floor(real(FFT_noise/2)) + 1;
y(find(y>1)) = +1;
y(find(y<-1)) = -1;

yt = (y+1)/2;

for ii=1:carrier
if(yt(ii)~=s(ii))
error(i)=error(i)+1; % if there is error occur, error add one
end
end

end

err_prob = error/carrier; % error probability
theory = 0.5*erfc(sqrt(10.^(Eb_No/10)));
 

which part of this doesn't work ?
 

The part of simulation does not work...but i don't know whether it is due to the noise problem or others.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top