comnum.theory_quantization_mse#

comnum.theory_quantization_mse(bits, full_scale, sigma=1.0)#

The exact mean squared error of a uniform mid-rise quantiser of bits bits and full scale full_scale for a Gaussian input of standard deviation sigma (one dimension): granular and overload (clipping) noise together.

Parameters:
  • bits (int) – resolution N.

  • full_scale (float) – the full scale A.

  • sigma (float) – standard deviation of the input.

Returns:

the mean squared error.

Return type:

float

Raises:

ValueError – for an invalid parameter (the message names it).

Examples

>>> import comnum
>>> round(comnum.theory_quantization_mse(2, comnum.optimal_loading(2)), 4)
0.1188