3. Mid-tread behavior at zero

The mid-riser implementation of a quantizer has the major drawback that the input value of zero cannot be displayed without an error at the output. With $x_k = 0$ at the input, any arbitrarily low noise superimposed to it will be inherently amplified to the magnitude $\Delta q/2$. Therefore, we can define a new requirement that zero-input signals are mapped to the quantization step at zero. Such behavior of a quantizer is then called **"mid-tread"**.

Mapping a real-valued input to an integer-valued output can be simply done by truncating as described in the second half of the previous section or by rounding the signal. The latter case will be discussed in the following.

With the requirement that there has to be a quantization step at zero and if the input signal is still symmetric around zero (bipolar) then, together with the zero step, a simple uniform quantizer will have an odd total number $S$ of steps located at $n\cdot \Delta q$ with some specific $n\in\mathbb{Z}$, with $\frac{S-1}{2}$ values below zero and as many above zero.

The quantization rule can be formulated using the rounding operator or the floor operator: $$ \begin{align} x_{\text{Q},k} & = \Delta q\cdot \text{round}\left(\frac{x_k}{\Delta q}\right)\\ & = \Delta q\cdot \left(\left\lfloor \frac{x_k}{\Delta q}+\frac{1}{2}\right\rfloor\right). \tag{1} \end{align} $$ The quantization error depends on the input signal in the following way: $$ e_{\text{Q}, k} = \Delta q\cdot \left(\left\lfloor \frac{x_k}{\Delta q}+\frac{1}{2}\right\rfloor\right) - x_k\\ $$ and can be shown to be limited to the range $$ -\frac{\Delta q}{2} \leq e_{\text{Q}, k} \leq \frac{\Delta q}{2}. \tag{3} $$ The mid-tread quantization by rounding is the one usually found in real implementations because it handles all the drawbacks of the mid-riser implementations:

- The values at the output can be translated to integers simply by normalization with $\Delta q$;
- The quantization error magnitude is limited to half the step size;
- The step at zero suppresses low-magnitude noise superimposed zero-valued input

As mentioned above, the mid-tread implementation implies an odd number of steps. Thus, in order to make the quantized values representable by $N_\text{Q}$ bits, the quantizer has to be "over-dimensioned" such that it has $S=2^{N_\text{Q}}+1$ steps. The translation of quantized values to binary codewords would then omit one step, usually the one with the highest positive value. The folowing webdemo slide does this if an even number od steps is requested together with the mid-tread behavior at zero. As can be seen from these simulations, input values that should be mapped to the not present last step are clipped to the next lower one thus increasing the quantization error.

In an application of such a quantizer this larger error for one of $S$ steps can be tolerated, since the contribution of this error is not high for large values of $S$ and can be made neglectable by increasing $S$.

If, however, the resolution is limited to a low number of bits, the SNR penalty caused by not using the last step can grow beyond 2.4 dB (for 4 bits) and more. To overcome this, the signal can be limited to use a reduced dynamic range of the quantizer. By doing so, also the lowest-valued step becomes unused but the absolute value of possible quantization errors is reduced to $\frac{\Delta q}{2}$. In the webdemo, this can be seen by applying different number of stepss and checking/unchecking the option "Optimize rounding".

In the case of the mid-tread quantization, an even number of steps $S$ leads to a non-symmetric behavior: Without the step at zero, $S/2$ negative and $S/2-1$ positive values can occur in the quantized signal.

The input signal of a quantizer can also be discrete-valued. Such quantizers can be used to reduce the number of quantization steps in order to require less bits per signal sample. For modelling this (re-)quantization, the input signal can also be assumed continuous-valued.