Main Content


Mean of quantization error



m = errmean(q) returns the mean of a uniformly distributed random quantization error that arises from quantizing a signal by quantizer object q.


The results are not exact when the signal precision is close to the precision of the quantizer.


collapse all

Find the mean of the quantization error for the quantizer object q.

q = quantizer;
m = errmean(q)
m = -1.5259e-05

Compare this result to the sample mean from a Monte Carlo experiment.

r = realmax(q);
u = 2*r*rand(1000,1)-r;  % Original signal
y = quantize(q,u);       % Quantized signal
e = y - u;               % Error
m_est = mean(e)          % Estimate of the error mean
m_est = -1.5028e-05

Input Arguments

collapse all

Input quantizer object, specified as a quantizer object.

Version History

Introduced in R2008a

See Also

| |