专栏
标签
误码率计算
一般问题
发布于 2025-04-22 16:17:05
查看 12过去432天

在学习16QAM的解调,使用的是QAMdmod函数库的一个例子,硬解调,在moddata数据前正常运行,通过高斯信道的运算后解调误码率出奇的高,找不到问题所在
using TySignalProcessing
using TyPlot
using TyMath
using TyCommunication
using TyBase

#-------------------------------1、生成随机信号-------------------------------------
#信源bit,随机信号
rng = MT19937ar(1234)
y = randn(rng, 8000, 1)

#--------------------2、对信号进行信源编码-dpcm编码-------------------------
initcodebook = collect(-1:0.005:2)

优化参数

predictor, codebook, partition = dpcmopt(vec(y), 1, initcodebook)
encodex, = dpcmenco(vec(y), codebook, partition, vec(predictor))

十进制转二进制

i_b = int2bit(encodex, 9)

#--------------------3、对信号进行差错控制编码-卷积编码---------------------

生成网格结构

trellis1 = poly2trellis([5 4], [23 35 0; 0 5 13])
#卷积编码
codedout, = convenc(i_b, trellis1) #2进制输入信号

#----------------调制--------------
hQAMMod = comm_GeneralQAMModulator()

hQAMMod.Constellation = [
-3-3im, -3-1im, -3+3im, -3+1im, # 0 1 2 3
-1-3im, -1-1im, -1+3im, -1+1im, # 4 5 6 7
3-3im, 3-1im, 3+3im, 3+1im, # 8 9 10 11
1-3im, 1-1im, 1+3im, 1+1im ] # 12 13 14 15

data4 = bit2int(codedout,4) #16进制输入信号,每4位二进制码转换为1位16进制码

modData4 = step(hQAMMod, data4) #QAM已调信号

hAWGN = comm_AWGNChannel(; #信道模型·
NoiseMethod="Signal to noise ratio (SNR)",
SNR=30,
SignalPower=0.89,
RandomStream="mt19937ar with seed",
Seed=1234,
)

noisySignal = step(hAWGN, modData4)#信道调制

#--------------解调--------------

hQAMDemod = comm_GeneralQAMDemodulator()
hError = comm_ErrorRate()

receivedData = step(hQAMDemod, noisySignal)
errorStats = step(hError, data4, receivedData)
es1 = "Error rate = %f\n"
es2 = "Number of errors = %d\n"
fprintf(es1, errorStats[1])
fprintf(es2, errorStats[2])

所属专栏:Syslab基础平台
产品信息:Syslab科学计算环境
通信

全部回答 1

发布于 2025-04-23 09:14:30

您好,您当前代码中解调的星座图没有进行设置,因此会出现解调误码率高的问题,请您按照以下方式设置
需要设置解调的星座图:

hQAMDemod = comm_GeneralQAMDemodulator()
hQAMDemod.Constellation = hQAMMod.Constellation

设置完成后,误码率是0。

用户
和原帖交流更多问题细节吧,去
我要发帖 我要发帖
资料中心 资料中心
查看更多>
热门帖子 热门帖子
主要贡献者 主要贡献者
过去7天