File Exchange

image thumbnail

QPSK Simulation

version 1.0 (1.1 KB) by

qpsk simulation in matlab

5 Downloads

Updated

No License

simulates a baseband qpsk system

Comments and Ratings (3)

Mak

Mak (view profile)

i have been working on viterbisim.m which is a built-in matlab example for understanding the ber tool.. i that i have tried to change the code rate to 2/3 with trellis structure of
t = poly2trellis([5 4],[23 35 0; 0 5 13]); but output ber graph is completely unexpected n highly fluctuated.. i m not working on simulink ..plz help me how can i resolve this issue ..
basically my project is on mimo-ofdm so far i have done ofdm transceiver which works ok without rayleigh which is like this
data source ->FEC(2/3)->qpsk->ofdm ......but i need to send bits in a loop for more accurate ber that is i dont have to guess in advance ! thats y i m working on viterbisim.m... plz help m i have hardly got 2months to submit it ...
thanks in advance

Duane Hanselman

No need to download, here is the M-file contents:

N = 1000;
iter = 100;
expSymErrs = 10;
EbNo = 0:1:10;
bitsnrdB = EbNo;
bitsnrlin = 10.^(bitsnrdB/10);
theo_berr = 0.5*erfc(sqrt(bitsnrlin));
theo_serr = 1 - (1 - theo_berr).^2;
semilogy(bitsnrdB,theo_berr,'m', bitsnrdB,theo_serr,'g');
axis([0 max(EbNo) 1e-6 1]);
grid on
hold on
drawnow
for t = 1:length(EbNo)
idx = 1;
errSym = 0;
while ((idx <= iter) || (sum(errSym) <= expSymErrs))
s = 1/sqrt(2)*(randsrc(N,1) + j*randsrc(N,1));
% Compute EsNo
EsNo = EbNo(t) + 10*log10(2);
EsNolin = 10.^(EsNo/10);
No = 1/EsNolin; % Assuming Es = 1
var = No; %
n = sqrt(var/2)*(randn(N,1) + j*randn(N,1));
x = s + n;
% Detection follows
alph = [1+j, 1-j, -1+j, -1-j]/sqrt(2);
detx = zeros(N,1);
for tt = 1:N
[val,id] = min(abs(x(tt) - alph));
detx(tt) = alph(id);
end
errSym(idx) = length(find(s ~= detx));
idx = idx + 1;
end
pe(t) = mean(errSym)/N;
semilogy(EbNo(t),pe(t),'-ob')
drawnow
end

Richard Brown

Reasons for giving a '1':
* Script with malicious clear all, close all
* Undocumented
* Even the graph it plots is unlabelled
* Requires communications toolbox (e.g. randsrc), and this is not stated

This is clearly a homework problem, and of no use to anyone else. As its only value would be instructional, it should be very clearly documented. Suggest significant rewrite or removal

MATLAB Release
MATLAB 7.1.0 (R14SP3)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today