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')
 

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

 

32-qam

pff.. .....Thanks a lot
 

32 qam symbol error probability

welcome

**broken link removed**
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…