当前位置: 首页 > news >正文

【限免】16PAM、16PSK、16QAM、16CQAM星座图及误码率【附MATLAB代码】

​微信公众号:智能电磁频谱算法 QQ交流群:949444104

主要内容

MATLAB代码

% Parameters
M = 16;
N = 4; % Number of circles for CQAM
SNR_dB = 0:2:25; % Extended SNR range to reach higher values
num_symbols = 1e5; % Total number of symbols for simulation
​
% Define the constellation points for 16-PAM, 16-PSK, and 16-QAM
constellation_pam = pammod(0:(M-1), M, 0, 'gray');  % 16-PAM
constellation_psk = pskmod(0:(M-1), M, 0, 'gray');  % 16-PSK
constellation_qam = qammod(0:(M-1), M, 'gray');     % 16-QAM
constellation_cqam = generate_16CQAM(M, N);
​
​
% Calculate SEP vs SNR for each modulation scheme
SEP_vs_SNR = zeros(length(SNR_dB), 4);
​
for i = 1:length(SNR_dB)SNR_linear = 10^(SNR_dB(i)/10);SEP_vs_SNR(i, 1) = sep_pam(SNR_linear);SEP_vs_SNR(i, 2) = sep_psk(SNR_linear);SEP_vs_SNR(i, 3) = sep_qam(SNR_linear);SEP_vs_SNR(i, 4) = sep_cqam(SNR_linear);
end
​
​
​
% Plot SEP vs SNR
figure;
semilogy(SNR_dB, SEP_vs_SNR(:, 1), 'r-', 'LineWidth', 2);
hold on;
semilogy(SNR_dB, SEP_vs_SNR(:, 2), 'g--', 'LineWidth', 2);
semilogy(SNR_dB, SEP_vs_SNR(:, 3), 'b-.', 'LineWidth', 2);
semilogy(SNR_dB, SEP_vs_SNR(:, 4), 'm:', 'LineWidth', 2);
xlabel('E_b/N_0 (dB)');
ylabel('SEP');
legend('16-PAM', '16-PSK', '16-QAM', '16-CQAM');
title('SEP vs SNR for 16-PAM, 16-PSK, 16-QAM, and 16-CQAM');
grid on;
​
​
​
​
% Function to generate 16-CQAM constellation
function constellation = generate_16CQAM(M, N)n = M / N;R1 = 1; % Smallest radiusconstellation = [];for i = 1:NRi = R1 * i; % Increasing radius for each circlebase_angle = pi/4 * (i-1); % Rotate each circle by 45 degrees more than the previous oneangles = (0:n-1) * (2 * pi / n) + base_angle;constellation = [constellation, Ri * exp(1i * angles)]; % Append pointsend
end
​
% Function to calculate theoretical SEP for 16-PAM
function sep = sep_pam(SNR)M = 16;sep = 2 * (M - 1) / M * qfunc(sqrt(6 * SNR / (M^2 - 1)));
end
​
% Function to calculate theoretical SEP for 16-PSK
function sep = sep_psk(SNR)M = 16;sep = 2 * qfunc(sqrt(2 * SNR) * sin(pi / M));
end
​
% Function to calculate theoretical SEP for 16-QAM
function sep = sep_qam(SNR)M = 16;Ps_M = 2 * (1 - 1/sqrt(M)) * qfunc(sqrt(3 / (M - 1) * SNR));sep = 1 - (1 - Ps_M)^2;
end
​
% Function to calculate theoretical SEP for 16-CQAM
function sep = sep_cqam(SNR)M = 16;R = 1; % Smallest radiusN = 4;sum_sq = sum((1:N).^2);Es_avg = (4 / M) * R^2 * sum_sq;SNR_eff = SNR * Es_avg;sep = 2 * (M - 1) / M * qfunc(sqrt(6 * SNR_eff / (M^2 - 1)));
end
% Define the constellation points for 16-PAM, 16-PSK, and 16-QAM
M = 16;
constellation_pam = pammod(0:(M-1), M, 0, 'gray');  % 16-PAM
constellation_psk = pskmod(0:(M-1), M, 0, 'gray');  % 16-PSK
constellation_qam = qammod(0:(M-1), M, 'gray');  % 16-QAM
​
% Normalize constellations so that average symbol energy Es = 1
constellation_pam = normalize_energy(constellation_pam);
constellation_psk = normalize_energy(constellation_psk);
constellation_qam = normalize_energy(constellation_qam);
​
% Generate 16-CQAM constellation
N = 4; % Change N to other values as needed
constellation_cqam = generate_16CQAM(M, N);
constellation_cqam = normalize_energy(constellation_cqam);
​
% Calculate Euclidean distances for each modulation
dmin_pam = calculate_dmin(constellation_pam);
dmin_psk = calculate_dmin(constellation_psk);  % Calculate dmin for 16-PSK
dmin_qam = calculate_dmin(constellation_qam);
dmin_cqam = calculate_dmin(constellation_cqam);
​
% Calculate PAPR for each modulation
calculatePAPR = @(signal) max(abs(signal).^2) / mean(abs(signal).^2);
papr_pam = calculatePAPR(constellation_pam);
papr_psk = calculatePAPR(constellation_psk);
papr_qam = calculatePAPR(constellation_qam);
papr_cqam = calculatePAPR(constellation_cqam);
​
% Plot PAPR vs dmin
figure;
hold on;
scatter(dmin_pam, papr_pam, 'filled', 'DisplayName', '16-PAM');
scatter(dmin_psk, papr_psk, 'filled', 'DisplayName', '16-PSK');
scatter(dmin_qam, papr_qam, 'filled', 'DisplayName', '16-QAM');
scatter(dmin_cqam, papr_cqam, 'filled', 'DisplayName', '16-CQAM');
xlabel('d_{min}');
ylabel('PAPR');
title('Comparison of PAPR and Euclidean Distance / d_{min} in 16-PAM, 16-PSK, 16-QAM, and 16-CQAM');
legend('Location', 'best');
grid on;
hold off;
​
% Plot constellations
figure;
scatter(real(constellation_pam), imag(constellation_pam), 'filled', 'o');
title('16-PAM Constellation');
grid on;
axis equal;
for i = 1:length(constellation_pam)text(real(constellation_pam(i)), imag(constellation_pam(i)), ['s', num2str(i)], 'VerticalAlignment','bottom', 'HorizontalAlignment','right')
end
​
figure;
scatter(real(constellation_psk), imag(constellation_psk), 'filled', 'o');
title('16-PSK Constellation');
grid on;
axis equal;
for i = 1:length(constellation_psk)text(real(constellation_psk(i)), imag(constellation_psk(i)), ['s', num2str(i)], 'VerticalAlignment','bottom', 'HorizontalAlignment','right')
end
​
figure;
scatter(real(constellation_qam), imag(constellation_qam), 'filled', 'o');
title('16-QAM Constellation');
grid on;
axis equal;
for i = 1:length(constellation_qam)text(real(constellation_qam(i)), imag(constellation_qam(i)), ['s', num2str(i)], 'VerticalAlignment','bottom', 'HorizontalAlignment','right')
end
​
figure;
scatter(real(constellation_cqam), imag(constellation_cqam), 'filled', 'o');
title('16-CQAM Constellation');
grid on;
axis equal;
for i = 1:length(constellation_cqam)text(real(constellation_cqam(i)), imag(constellation_cqam(i)), ['s', num2str(i)], 'VerticalAlignment','bottom', 'HorizontalAlignment','right')
end
​
% Function to generate 16-CQAM constellation
function constellation = generate_16CQAM(M, N)n = M / N;R1 = 1; % Smallest radiusconstellation = [];for i = 1:NRi = R1 * i; % Increasing radius for each circlebase_angle = pi/4 * (i-1); % Rotate each circle by 45 degrees more than the previous oneangles = (0:n-1) * (2 * pi / n) + base_angle;constellation = [constellation, Ri * exp(1i * angles)]; % Append pointsend
end
​
% Function to calculate the minimum distance (dmin) in a constellation
function dmin = calculate_dmin(constellation)num_points = length(constellation);distances = inf(num_points*(num_points-1)/2, 1);k = 1;for i = 1:num_pointsfor j = i+1:num_pointsdistances(k) = abs(constellation(i) - constellation(j));k = k + 1;endenddmin = min(distances);
end
​
% Function to normalize the average symbol energy to 1
function normalized_constellation = normalize_energy(constellation)avg_energy = mean(abs(constellation).^2);normalized_constellation = constellation / sqrt(avg_energy);
end
​

MATLAB仿真结果

相关文章:

【限免】16PAM、16PSK、16QAM、16CQAM星座图及误码率【附MATLAB代码】

​微信公众号:智能电磁频谱算法 QQ交流群:949444104 主要内容 MATLAB代码 % Parameters M 16; N 4; % Number of circles for CQAM SNR_dB 0:2:25; % Extended SNR range to reach higher values num_symbols 1e5; % Total number of symbols for s…...

09-软件易用性

易用性是用户体验的一个重要方面,网站建设者一般会沉溺于自己的思维习惯,而造成用户使用的不畅。易用性不仅是专业UI/UE人员需要研究,对于网站建设其他岗位的人也应该了解一定的方法去检验和提升网站的易用性。通常对易用性有如下定义: 易理解…...

FPGA开发——独立仿真和联合仿真

一、概述 我们在进行FPGA开发的过程之中,大部分情况下都是在进行仿真,从而验证代码实现结果的正确与否,这里我们引入了独立仿真和联合仿真进行一个简单介绍。 联合仿真:一般我们在进行仿真之前需要在相应的软件中建立相应的工程…...

基于STM32瑞士军刀--【FreeRTOS开发】学习笔记(二)|| 堆 / 栈

堆和栈 1. 堆 堆就是空闲的一块内存,可以通过malloc申请一小块内存,用完之后使用再free释放回去。管理堆需要用到链表操作。 比如需要分配100字节,实际所占108字节,因为为了方便后期的free,这一小块需要有个头部记录…...

ABAP+从SAP发出去的PDF文件在第三方系统出现乱码

这是一个 ABAP转换PDF调用函数CALL FUNCTION CONVERT_OTF的问题记录,关乎字体STSong-Light-ldentity-H 和 STSong-Light的区别 背景: 做了一个增强,是采购订单审批后自动发送采购订单PDF1到企业微信,用户再将企业微信收到的P…...

基于springsecurity的会话并发处理功能(附代码)

1. 需求 在项目中往往需要实现一个限制不同设备同时登录的功能,比如我只允许同一时间只有一个客户端能登录,而其他的已登陆的客户端会被挤出来 而springsecurity中恰好就帮我们实现好了对应的接口功能,我们只需要自定义配置就好 2. 结合sp…...

Redis底层数据结构的实现

文章目录 1、Redis数据结构1.1 动态字符串1.2 intset1.3 Dict1.4 ZipList1.5 ZipList的连锁更新问题1.6 QuickList1.7 SkipList1.8 RedisObject 2、五种数据类型2.1 String2.2 List2.3 Set2.4 ZSET2.5 Hash 1、Redis数据结构 1.1 动态字符串 Redis中保存的Key是字符串&#xf…...

制作excel模板,用于管理后台批量导入船舶数据

文章目录 引言I 数据有效性:基于WPS在Excel中设置下拉框选择序列内容II 数据处理:基于easyexcel工具实现导入数据的持久化2.1 自定义枚举转换器2.2 ExcelDataConvertExceptionIII 序列格式化: 基于Sublime Text 文本编辑器进行批量字符操作引言 需求: excel数据导入模板制…...

领略诗词之妙,发觉生活之美。

文章目录 引言落霞与孤鹜齐飞,秋水共长天一色。野渡无人舟自横。吹灭读书灯,一身都是月。我醉欲眠卿且去,明朝有意抱琴来。赌书消得泼茶香,当时只道是寻常。月上柳梢头,人约黄昏后。最是人间留不住,朱颜辞镜花辞树。山中何事?松花酿酒,春水煎茶。似此星辰非昨夜,为谁风…...

基于FFmpeg和SDL的音视频解码播放的实现过程与相关细节

目录 1、视频播放器原理 2、FFMPEG解码 2.1 FFMPEG库 2.2、数据类型 2.3、解码 2.3.1、接口函数 2.3.2、解码流程 3、SDL播放 3.1、接口函数 3.2、视频播放 3.3、音频播放 4、音视频的同步 4.1、获取音频的播放时间戳 4.2、获取当前视频帧时间戳 4.3、获取视…...

SSIS_SQLITE

1.安装 SQLite ODBC 驱动程序 2.添加SQLite数据源 在“用户DSN”或“系统DSN”选项卡中,点击“添加”。选择“SQLite3 ODBC Driver”,然后点击“完成”。在弹出的配置窗口中,设置数据源名称(DSN),并指定S…...

Redis 7.x 系列【27】集群原理之通信机制

有道无术,术尚可求,有术无道,止于术。 本系列Redis 版本 7.2.5 源码地址:https://gitee.com/pearl-organization/study-redis-demo 文章目录 1. 概述2 节点和节点2.1 集群拓扑2.2 集群总线协议2.3 流言协议2.4 心跳机制2.5 节点握…...

【五】MySql8基于m2芯片arm架构Ubuntu24虚拟机安装

文章目录 1. 更新系统包列表2. 安装 MySQL APT Repository3. 更新系统包列表4. 安装 MySQL Server5. 运行安全安装脚本6. 验证 MySQL 安装7. 配置远程连接7.1 首先要确认 MySQL 配置允许远程连接:7.2 重启 MySQL 服务:7.3 检查 MySQL 用户权限&#xff1…...

【Hot100】LeetCode—279. 完全平方数

目录 题目1- 思路2- 实现⭐完全平方数——题解思路 3- ACM 实现 题目 原题连接:279. 完全平方数 1- 思路 思路 动规五部曲 2- 实现 ⭐完全平方数——题解思路 class Solution {public int numSquares(int n) {// 1. 定义 dpint[] dp new int[n1];//2. 递推公式…...

腾讯云开发者《中国数据库前世今生》有奖创作季

在数字化潮流席卷全球的今天,数据库作为IT技术领域的“活化石”,已成为数字经济时代不可或缺的基础设施。那么,中国的数据库技术发展经历了怎样的历程?我们是如何在信息技术的洪流中逐步建立起自己的数据管理帝国的呢?…...

redis:清除缓存的最简单命令示例

清除redis缓存命令(执行命令列表见截图) 1.打开cmd窗口,并cd进入redis所在目录 2.登录redis redis-cli 3.查询指定队列当前的记录数 llen 队列名称 4.清除指定队列所有记录 ltrim 队列名称 1 0 5.再次查询,确认队列的记录数是否已清除...

基于深度学习算法,支持再学习功能,不断提升系统精准度的智慧地产开源了。

智慧地产视觉监控平台是一款功能强大且简单易用的实时算法视频监控系统。它的愿景是最底层打通各大芯片厂商相互间的壁垒,省去繁琐重复的适配流程,实现芯片、算法、应用的全流程组合,从而大大减少企业级应用约95%的开发成本。通过计算机视觉和…...

Cmake生成的Xcode工程相对路径与绝对路径的问题

Cmake生成的Xcode工程相对路径与绝对路径的问题 文章目录 Cmake生成的Xcode工程相对路径与绝对路径的问题前言修改.pbxproj文件验证工程小结 前言 由于Cmake的跨平台的自动化构建的方便性以及他广泛应用于编译过程的管理,在开发过程中难免用到Cmake。我也使用Cmake…...

“机器说人话”-AI 时代的物联网

万物互联的物联网愿景已经提了许多年了,但是实际效果并不理想,除了某些厂商自己的产品生态中的产品实现了互联之外,就连手机控制空调,电视机和调光灯都没有实现。感觉小米做的好一点,而华为的鸿蒙的全场景,…...

C#高级:数据库中使用SQL作分组处理3(ROW_NUMBER() 关键字)

一、分组后找出指定序号的数据 【需求】查出每个班级第三个注册入学的学生信息 【表和字段】Student: ID Class Name Registrationtime 【实现SQL】 WITH RankedStudents AS (SELECT ID,Class,Name,Registrationtime,ROW_NUMBER() OVER(PARTITION BY Class ORDER BY Registra…...

C++:std::is_convertible

C++标志库中提供is_convertible,可以测试一种类型是否可以转换为另一只类型: template <class From, class To> struct is_convertible; 使用举例: #include <iostream> #include <string>using namespace std;struct A { }; struct B : A { };int main…...

以下是对华为 HarmonyOS NETX 5属性动画(ArkTS)文档的结构化整理,通过层级标题、表格和代码块提升可读性:

一、属性动画概述NETX 作用&#xff1a;实现组件通用属性的渐变过渡效果&#xff0c;提升用户体验。支持属性&#xff1a;width、height、backgroundColor、opacity、scale、rotate、translate等。注意事项&#xff1a; 布局类属性&#xff08;如宽高&#xff09;变化时&#…...

为什么需要建设工程项目管理?工程项目管理有哪些亮点功能?

在建筑行业&#xff0c;项目管理的重要性不言而喻。随着工程规模的扩大、技术复杂度的提升&#xff0c;传统的管理模式已经难以满足现代工程的需求。过去&#xff0c;许多企业依赖手工记录、口头沟通和分散的信息管理&#xff0c;导致效率低下、成本失控、风险频发。例如&#…...

k8s业务程序联调工具-KtConnect

概述 原理 工具作用是建立了一个从本地到集群的单向VPN&#xff0c;根据VPN原理&#xff0c;打通两个内网必然需要借助一个公共中继节点&#xff0c;ktconnect工具巧妙的利用k8s原生的portforward能力&#xff0c;简化了建立连接的过程&#xff0c;apiserver间接起到了中继节…...

【JavaSE】绘图与事件入门学习笔记

-Java绘图坐标体系 坐标体系-介绍 坐标原点位于左上角&#xff0c;以像素为单位。 在Java坐标系中,第一个是x坐标,表示当前位置为水平方向&#xff0c;距离坐标原点x个像素;第二个是y坐标&#xff0c;表示当前位置为垂直方向&#xff0c;距离坐标原点y个像素。 坐标体系-像素 …...

【论文阅读28】-CNN-BiLSTM-Attention-(2024)

本文把滑坡位移序列拆开、筛优质因子&#xff0c;再用 CNN-BiLSTM-Attention 来动态预测每个子序列&#xff0c;最后重构出总位移&#xff0c;预测效果超越传统模型。 文章目录 1 引言2 方法2.1 位移时间序列加性模型2.2 变分模态分解 (VMD) 具体步骤2.3.1 样本熵&#xff08;S…...

如何在最短时间内提升打ctf(web)的水平?

刚刚刷完2遍 bugku 的 web 题&#xff0c;前来答题。 每个人对刷题理解是不同&#xff0c;有的人是看了writeup就等于刷了&#xff0c;有的人是收藏了writeup就等于刷了&#xff0c;有的人是跟着writeup做了一遍就等于刷了&#xff0c;还有的人是独立思考做了一遍就等于刷了。…...

AspectJ 在 Android 中的完整使用指南

一、环境配置&#xff08;Gradle 7.0 适配&#xff09; 1. 项目级 build.gradle // 注意&#xff1a;沪江插件已停更&#xff0c;推荐官方兼容方案 buildscript {dependencies {classpath org.aspectj:aspectjtools:1.9.9.1 // AspectJ 工具} } 2. 模块级 build.gradle plu…...

学校时钟系统,标准考场时钟系统,AI亮相2025高考,赛思时钟系统为教育公平筑起“精准防线”

2025年#高考 将在近日拉开帷幕&#xff0c;#AI 监考一度冲上热搜。当AI深度融入高考&#xff0c;#时间同步 不再是辅助功能&#xff0c;而是决定AI监考系统成败的“生命线”。 AI亮相2025高考&#xff0c;40种异常行为0.5秒精准识别 2025年高考即将拉开帷幕&#xff0c;江西、…...

C++ 设计模式 《小明的奶茶加料风波》

&#x1f468;‍&#x1f393; 模式名称&#xff1a;装饰器模式&#xff08;Decorator Pattern&#xff09; &#x1f466; 小明最近上线了校园奶茶配送功能&#xff0c;业务火爆&#xff0c;大家都在加料&#xff1a; 有的同学要加波霸 &#x1f7e4;&#xff0c;有的要加椰果…...