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.

[SOLVED] frequency offset QPSK Matlab code

Status
Not open for further replies.

ReComm

Member level 2
Joined
Aug 26, 2010
Messages
43
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Egypt
Activity points
1,627
Dear friends,

I modified the following matlab code for QPSK to use it in frequency offset analysis

code
====
%N=100000; % number of bits
N = 2*100000;
F_Offset =[0:100:5000]; % multiple frequency offset values

for x= 1 :length(F_Offset) % Frequency Offset
% Input Data Generation
data=rand(1,N)>0.5;
oddData = data(1:2:end);
evenData = data(2:2:end);

qpskModulated = sqrt(1/2)*(1i*(2*oddData-1)+(2*evenData-1)); %QPSK Mapping
% and normalization of energy to 1
% Frequency offset adding
TX = qpskModulated.* exp(2*j*pi*F_Offset(x)/(N/2)*[0:length(qpskModulated)-1]);

%--------------Demodulation-----------------------------

detected_real = real(TX)>=0;
detected_img = imag(TX)>=0;

estimatedBits=reshape([detected_img;detected_real],1,[]);
%-------------------------------------------------------
nErr(x) = size(find([data - estimatedBits]),2); % couting the number of errors
end
Err_QPSK = nErr/(N);

%=========================================================================
% Plotting output data
%=========================================================================

figure(1);

plot(F_Offset,Err_QPSK,'bs-','LineWidth',2);

axis([0 5000 1/N 1]);
grid on;
legend( 'simulation-QPSK');
xlabel('Freq Offset Hz')
ylabel('Bit Error Rate')
title('Bit error probability curve for QPSK')

But the problem , it gives my constant BER regardless of changing N ?
I think N is the frequency as it is no of bits.

is there any problem in the code
or using frequency offset formula

Thanks
wait your help.
 

sampling frequency must be included :)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top