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

正交振幅调制(QAM)

基本原理

参考书籍:樊昌信老师的《通信原理》第七版
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

源代码

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%            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);

仿真结果

在这里插入图片描述
在这里插入图片描述

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值