comm_QPSKDemodulator()工具箱BitOut参数与DecisionMethod不匹配
技术分享
发布于 2025-07-18 09:53:03
查看 1过去319天
问题现象
运行如下代码,报错ERROR: ArgumentError: When the DecisionMethod property is set to ‘Log-likelihood ratio’ or ‘Approximate log-likelihood ratio’, the bitOutput property must be ‘true’。

解决方法
报错原因是字符串大小写未兼容,将Log改成小写的log即可。
hMod = comm_QPSKModulator()
hMod.PhaseOffset = 0
hMod.BitInput = true
hMod.SymbolMapping = “Gray”
hDemodSoft = comm_QPSKDemodulator()
hDemodSoft.PhaseOffset = 0
hDemodSoft.BitOutput = true
hDemodSoft.SymbolMapping = “Gray”
hDemodSoft.DecisionMethod = “Approximate log-likelihood ratio”
hDemodSoft.VarianceSource = “Property” # Source of noise variance
hDemodSoft.Variance = 1 # will be refreshed in the simulation
Uw1Bit = [0; 0; 0; 0; 0; 0; 1; 1; 1; 1; 0; 0]
Uw1Mod = step(hMod, Uw1Bit)
Uw1Mod = Uw1Mod[:, 1]
llrSoft2 = step(hDemodSoft, Uw1Mod)
所属专栏:其他
产品信息:Syslab科学计算环境