Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

Help me fix Matlab code for finding error rate in 32-QAM modulation with awgn

Status
Not open for further replies.

groun

Newbie level 2
Joined
Jun 8, 2009
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,294
In a matlab code, i have to finde the symbol error rate of 32qam modulation with awgn and SNR from -30 to 30 and step 5. But the figure apears wrong. Can somebody tell me what i made wrong in the code???


clear
N=10^4;
M=32;

for SNR=-30:5:30
x1=randint(1,N,M);
y1=qammod(x1,M);

for t=1:N
awgn1 =awgn(y1,SNR,'measured');
end
ynoisy=awgn1+y1
z=qamdemod(ynoisy,M);

[num,rt]= symerr(x1,z);
end


close all
figure
semilogy(SNR,rt,'mx-');
axis([-30 30 10^-5 1])
grid on
legend( 'simulation-32QAM');
xlabel('Es/No, dB')
ylabel('Symbol Error Rate')
title('Symbol error probability for 32QAM')
 

Aya2002

Advanced Member level 4
Joined
Dec 12, 2006
Messages
1,142
Helped
184
Reputation
376
Reaction score
118
Trophy points
1,343
Location
Iraq
Activity points
8,019
32qam

M=32;
figure
hold on
axis([-30 30 10^-5 1])
grid on
legend( 'simulation-32QAM');
xlabel('Es/No, dB')
ylabel('Symbol Error Rate')
title('Symbol error probability for 32QAM')
for SNR=-30:5:30
x1=randint(1,N,M);
y1=qammod(x1,M);

%for t=1:N
%awgn1 =awgn(y1,SNR,'measured');
%end
ynoisy=y1+awgn(y1,SNR,'measured');
z=qamdemod(ynoisy,M);

[num,rt]= symerr(x1,z);

semilogy(SNR,rt,'mx-');

end

 

groun

Newbie level 2
Joined
Jun 8, 2009
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,294
32-qam

pff.. .....Thanks a lot
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top