2025年11月4日 星期二

QPSK 基頻信號星座图

 QPSK 基頻信號星座图




import numpy as np

import matplotlib.pyplot as plt


num_symbols = 1000


x_int = np.random.randint(0, 4, num_symbols) # 0 to 3

x_degrees = x_int*360/4.0 + 45 # 45, 135, 225, 315 度

x_radians = x_degrees*np.pi/180.0 # sin() 和 cos() 以弧度为输入

x_symbols = np.cos(x_radians) + 1j*np.sin(x_radians) # 生成 QPSK 复数符号

plt.plot(np.real(x_symbols), np.imag(x_symbols), '.')

plt.grid(True)

plt.show()


n = (np.random.randn(num_symbols) + 1j*np.random.randn(num_symbols))/np.sqrt(2) # 具备单位功率噪音的 AWGN

noise_power = 0.01

r = x_symbols + n * np.sqrt(noise_power)

plt.plot(np.real(r), np.imag(r), '.')

plt.grid(True)

plt.show()


沒有留言:

張貼留言

邊緣快篩與生成式 AI 智慧環境哨兵(Edge-Cloud AI EnvSentinel)

邊緣快篩與生成式 AI 智慧環境哨兵(Edge-Cloud AI EnvSentinel) 這套系統結合了 Wokwi ESP32 遙測 、 MQTT 傳輸 、 本地 LightGBM 異常快篩 、 SQLite 歷史存檔 、 Gemini 生成式 AI 診斷 與 Telegr...