2011 级硕士研究生数字通信 MatLab 仿真实验题
姓名
学号
1. 请采用 MatLab 分别对工作于 AWGN 信道的 PAM、PSK 和 QAM 信号的传输错误概率性能进
行仿真,并与理论结果进行比较。
1) 对于 PAM 信号传输在 AWGN 信道上的 Matlab 仿真
a.
simulink 仿真图
Random
Integer
Random Integer
Generator
Tx
Error Rate
Calculation
Rx
Error Rate
Calculation
M-PAM
M-PAM
Modulator
Baseband
Scope
AWGN
AWGN
Channel
图 1: simulink PAM 信号 AWGN 信道仿真图
b. 2PAM 和 4PAM 星座图
M-PAM
M-PAM
Demodulator
Baseband
图 2: 2PAM 星座图
1
2) 对于 PSK 信号传输在 AWGN 信道上的 Matlab 仿真
图 3: 4PAM 星座图
a.simulink 仿真图
Random
Integer
Random Integer
Generator
Tx
Error Rate
Calculation
Rx
Error Rate
Calculation
M-PSK
M-PSK
Modulator
Baseband
Scope
AWGN
AWGN
Channel
M-PSK
M-PSK
Demodulator
Baseband
图 4:simulink PSK 信号 AWGN 信道仿真图
b. 4PSK 和 16PSK 星座图
2
图 5: 4PSK 星座图
图 6: 16PSK 星座图
3) 对于 QAM 信号传输在 AWGN 信道上的 Matlab 仿真
a.simulink 仿真图
3
Random
Integer
Random Integer
Generator
Tx
Error Rate
Calculation
Rx
Error Rate
Calculation
Rectangular
QAM
Rectangular QAM
Modulator
Baseband
Scope
AWGN
AWGN
Channel
Rectangular
QAM
Rectangular QAM
Demodulator
Baseband
图 7:simulink QAM 信号 AWGN 信道仿真图
b. 16QAM 和 32QAM 星座图
图 8: 16QAM 星座图
4
4.理论值测量
图 9: 32QAM 星座图
%rang of Eb/N0: 5-20dB
按照《数字通信》编写程序
%Analysis of the symbol error probablility for M-PAM, M-PSK,M-QAM
%finished by JS
clc;clear;
Eb_N0 = logspace(0.5,2);
M = [2 4 8];
MPAM = zeros(3,50);
MQAM = zeros(3,50);
%MPAM;MQAM BER calculation
%caculate PM which is used in the QAM EBR calculation
%PM = 2*(1-1/sqrt(M(i)))*erfc(sqrt(3*EB_N0/(M-1)));
%1= evaluation of symbol error probability
for i = 1:3
%the BER formula of MPAM
MPAM(i,:)= 2*(1-1/M(i))*erfc(sqrt(Eb_N0 * 6 * log2(M(i))/(M(i)^2-1)));
%the BER formula of MQAM
PM = 2*(1-1/sqrt(M(i)))*erfc(sqrt(3*Eb_N0/(M(i)-1)));
MQAM(i,:)= 1.-(1.-PM).^2;
end
subplot(1,3,1);
semilogy(10*log10(Eb_N0),MPAM(1,:),'.',10*log10(Eb_N0),MPAM(2,:),'*',10
*log10(Eb_N0),MPAM(3,:),'o');
title('MPAM');
axis([-6 20 1e-6 1e-1]);
subplot(1,3,2);
axis([5 20 1e-6 1e-1]);
semilogy(10*log10(Eb_N0),MQAM(1,:),'r-',10*log10(Eb_N0),MQAM(2,:),'g-',
5
10*log10(Eb_N0),MQAM(3,:),'b-');
title('MQAM');
%MPAM BER calculation,it can only caculate BER of MPAM when M=2 and
%M=4;there is only formula of BER when M=2 and M=4 in the book(page 196)
P2PAM = zeros(1,50);
P4PAM = zeros(1,50);
%2PAM
P2PAM(1,:) = erfc(sqrt(2*Eb_N0));
%4PAM
P4PAM(1,:) = 2*erfc(sqrt(2*Eb_N0)).*(1-0.5*erfc(sqrt(2*Eb_N0)));
subplot(1,3,3);
semilogy(10*log10(Eb_N0),P2PAM,'r-',10*log10(Eb_N0),P4PAM);
title('P4PAM and P2PAM');
仿真结果图
10-2
10-4
10-6
MPAM
100
10-5
10-10
10-15
P4PAM and P2PAM
MQAM
100
10-50
0
10
10-20
5
20
10
15
10-100
5
20
10
15
20
图 10:程序仿真结果图
4.仿真实验与理论值比较
2
MPAM(SNR = 5dB)
0.0039
BER 仿真结果
0.0059
BER 理论值
MPSK(SNR = 5dB)
BER 仿真结果
BER 理论值
MQAM(SNR = 5dB)
BER 仿真结果
BER 理论值
2
0.005
0.0059
16
0.019
0.0418
4
0.18
0.0418
4
0.005
0.0059
32
0.021
0.0880
6
从仿真结果可以看出,仿真结果与理论值比较相近,由于仿真模块参数等一些问题,有些值与实际
计算的理论值还存在一定差距。
7