目录
QAM调制仿真流程图:?
QAM解调仿真流程图:?
(1)16QAM星座点图,如下图所示:
? ?结果分析:此为16QAM星座点图,将此仿真结果根据与课堂所看到与学到的16QAM星座点图进行比对,发现完全一致,所以得出对于16QAM星座点图的仿真实验成功!!
(2)16-QAM载波调制信号在AWGN信道下的误比特率性能比较,如下图所示:
?
? ? ?结果分析:由图可知,16QAM的误符号率和仿真理论误符号率完全拟合,16QAM的误比特率在性躁比越来越高情况下拟合情况和仿真理论误比特率越来越接近。
clear;clc;
nsymbol=100000;
M=16;
graycode=[0 1 3 2 4 5 7 6 12 13 15 14 8 9 11 10];
EsN0=5:20;
snr1=10.^(EsN0/10);
msg=randi([0,15],1,nsymbol);
msg1=graycode(msg+1);
msgmod=qammod(msg1,M);
scatterplot(msgmod);
spow=norm(msgmod).^2/nsymbol;
for i=1:length(EsN0)
sigma=sqrt(spow/(2*snr1(i)));
rx=msgmod+sigma*(randn(1,length(msgmod))+1i*randn(1,length(msgmod)));
y=qamdemod(rx,M);
decmsg=graycode(y+1);
[err1,ber(i)]=biterr(msg,decmsg,log2(M));
[err2,ser(i)]=symerr(msg,decmsg);
end
p4=2*(1-1/sqrt(M))*qfunc(sqrt(3*snr1/(M-1)));
ser1=1-(1-p4).^2;
ber1=1/log2(M)*ser1;
figure();
semilogy(EsN0,ber,'o',EsN0,ser,'*',EsN0,ser1,EsN0,ber1,'-',EsN0,ber1,'-.');
title('16QAM-AWGN')
xlabel('Es/N0');ylabel('SER AND BER');
legend('ber simulation','ser simulatin','ser theory','ber theory');