正交振幅调制(QAM)的星座图、误码率(一)

正交振幅调制(QAM)

  • 基本原理
    • 源代码
      • 仿真结果

基本原理

参考书籍:樊昌信老师的《通信原理》第七版
正交振幅调制(QAM)的星座图、误码率(一)_第1张图片
正交振幅调制(QAM)的星座图、误码率(一)_第2张图片
正交振幅调制(QAM)的星座图、误码率(一)_第3张图片
正交振幅调制(QAM)的星座图、误码率(一)_第4张图片
正交振幅调制(QAM)的星座图、误码率(一)_第5张图片

源代码

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%            16QAM 调制与解调
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clc;
close all;
clear all;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%               参数设置
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
M =16;     % 16进制
k = log2(M);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                 信源
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
count=1e4;
x = randi([0 M-1],1,count);


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                 调制
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
y = qammod(x,M);
scatterplot(y);
title('接收信号星座图');



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%         信道(加入高斯白噪声)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SNR=20;   % 信噪比
y_noise = awgn(y,SNR);  % 加入高斯白噪声
scatterplot(y_noise);
title('接收信号星座图(SNR=20)');


SNR=-20;   % 信噪比
y_noise1 = awgn(y,SNR);  % 加入高斯白噪声
scatterplot(y_noise1);
title('接收信号星座图(SNR=-20)');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                 解调
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
y1=qamdemod(y_noise,M);      % 解调
scatterplot(y1);
title('解调信号星座图(SNR=-20)'); 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                 误码率计算
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 sum_error=0;
for n=1:count
    if y1(n)~=x(n)
        sum_error=sum_error+1;
    end
end
mean_error=sum_error/count;
fprintf('误码数为%g\n',sum_error);
fprintf('误码率为%g\n',mean_error);

仿真结果

正交振幅调制(QAM)的星座图、误码率(一)_第6张图片
在这里插入图片描述

你可能感兴趣的:(PSK调制,数字信号处理,matlab,信号处理)