2

我有一个信号具有复杂的正态分布,均值为 0,方差为 1。我想用统一的量化器将其量化为 512 个级别。我通过以下方式在 MATLAB 中生成信号-

s = sqrt(0.5).*(randn(1,numBits) + 1i*randn(1,numBits));

我正在通过以下方式用 512 个级别量化范围(-1,1)中的信号:

min = -1;

max = 1;

q = (max-min)/2^9;

quantSignal = round(s/q)*q;

这是量化这种信号的正确方法吗?我将不胜感激对此的任何意见。

4

1 回答 1

1

您使用的量化公式会将输入值映射到量化版本。但是,它不会将结果限制为仅 512 个级别,因为您的输入信号可能超出[-1,+1]范围,并且您没有做任何事情来限制量化器输出(或输入)。

要限制您可以使用的值minmax内置函数。但是,由于它们使用复数的模数,因此您必须首先将数字分成实部和虚部。因此,量化具有实部和虚部的复数,每个都限制在范围内,[minValue,maxValue]可以通过以下方式完成:

q = (maxValue-minValue)/(2^9-1);
realPart = min(max(real(s),minValue),maxValue);
realPart = minValue + round((realPart-minValue)/q)*q;
imagPart = min(max(imag(s),minValue),maxValue);
imagPart = minValue + round((imagPart-minValue)/q)*q;
quantSignal = realPart + j*imagPart;

我之前提到过,具有单位方差的正常信号通常不会限制在[-1,1]范围内(或任何范围内)。因此,通常尝试最小化量化误差的度量,例如均方误差(未量化输入和相应量化输出之间的平方差的期望值)。

For a uniform quantizer and given specific signal characteristics (in this case a complex Gaussian signal) this mean squared error is a function of the number of quantization levels and the quantizer's input range. For 512 levels, the real and imaginary parts should ideally be within approximately +/- 4.2 standard deviations. Since your standard deviation is sqrt(0.5) for the real and imaginary parts, this can be achieved with

maxValue = 4.2*sqrt(0.5);
minValue = -maxValue;

Should you need the real and imaginary part of your quantized output to be constrained to a specific range, then you may apply a scaling factor at the output of the quantizer (e.g. divide by 4.2*sqrt(0.5) to get the real and imaginary part constrained to [-1,+1]).

于 2015-09-26T03:16:19.457 回答