2. Mid-riser behavior at zero

#### 2.1 Rounding-based quantizer with mid-riser behavior

If the number of steps is required to be even and the input signal range is symmetric around zero (bipolar), then the simplest uniform quantizer has the same number of positive and negative possible output levels and the two steps with the smallest magnitude are located at $\pm \Delta q / 2$. When we equally distribute the remaining quantization steps, we obtain the quantization rule $$x_{\text{Q},k} = \Delta q\cdot \left(\left\lfloor \frac{x_k}{\Delta q}\right\rfloor+\frac{1}{2}\right), \tag{1}$$ where the notation $\left\lfloor x\right\rfloor$ describes the operation of truncating the decimal values to the nearest integer towards negative infinity (a.k.a "floor operation"). This behavior can also be seen as rounding to the nearest value exactly between two integer multiples of the step size.

Thus, a value of zero is not possible at the output of the quantizer. Indeed, zero is the threshold between the two least-magnitude-steps introduced above. Such a quantizer behavior is often called "mid-riser".

The output signal can take a value from this set: $$x_{\text{Q}} = \Delta q \cdot \left(m- \frac{1}{2}\right),~m=-\left(\frac{S}{2}-1\right),~\ldots,~\frac{S}{2}$$

As defined above, the quantization error can be described to depend on the input signal in the following way: \begin{align} e_{\text{Q}, k} &= \Delta q\cdot \left(\left\lfloor \frac{x_k}{\Delta q}\right\rfloor+\frac{1}{2}\right) - x_k\\ \frac{e_{\text{Q}, k}}{\Delta q} &= \left\lfloor \frac{x_k}{\Delta q}\right\rfloor - \frac{x_k}{\Delta q} +\frac{1}{2}. \tag{2} \end{align} So, it can be shown that $$-\frac{\Delta q}{2} \leq e_{\text{Q}, k} \leq \frac{\Delta q}{2}. \tag{3}$$ With the maximal and minimal output values being $$\text{max}\left\{x_{\text{Q},k}\right\} = -\text{min}\left\{x_{\text{Q},k}\right\} =\Delta q \cdot \frac{S - 1}{2},$$ we can show that the equation $(3)$ holds for $\left|x_k\right|\leq \tilde{x}$ with $$\tilde{x} = \Delta q \cdot \frac{S}{2} = x_\text{max}, \tag{4}$$ which only re-writes the definition $\Delta q = \frac{2x_\text{max}}{S}$ from above and proves that the entire input range is quantized with an error not higher than $\frac{\Delta q}{2}$ in magnitude.

#### 2.2 Truncation-based quantizer

One drawback of the quantizer described above is that its output values, even after normalizing by $\Delta q$, are not integers, although they are countable and finite. Virtually subtracting $1/2$ from the normalized quantized signal makes the signal integer-valued by keeping all the described properties. This simplifies binary representation but the values don't resemble the actual signal anymore.

Another possibility to obtain an integer from a real number is to truncate its fractional part (after the decimal point) and thus implement a floor operation $$x_{\text{Q},k} = \Delta q\cdot \left\lfloor \frac{x_k}{\Delta q}\right\rfloor. \tag{5}$$ The quantized values, if normalized by the quantization step size, are represented by integers that are non-symmetrically divided into positive and negative values such that there is one more value below zero than above zero and the zero itself, so the steps are directly aranged corresponding to two's complements where values between $-\frac{S}{2}$ and $\frac{S}{2}-1$ can be represented.

The relation of the quantization error and the input signal is calculated by \begin{align} e_{\text{Q}, k} &= \Delta q\cdot \left\lfloor \frac{x_k}{\Delta q}\right\rfloor - x_k\\ \frac{e_{\text{Q}, k}}{\Delta q} &= \left\lfloor \frac{x_k}{\Delta q}\right\rfloor - \frac{x_k}{\Delta q} \tag{6} \end{align} and can be shown to be $$-\Delta q \leq e_{\text{Q}, k} \leq 0. \tag{7}$$ To cross-check the validity of the error range, we observe the minimal and maximal output values and relate them to the input range: \begin{align} \text{max}\left\{x_{\text{Q},k}\right\} &= \Delta q \cdot \left(\frac{S}{2} - 1\right) = x_\text{max} - \Delta q\\ \text{min}\left\{x_{\text{Q},k}\right\} &=-\Delta q \cdot \frac{S}{2} = -x_\text{max}. \end{align} This shows that the error magnitude is limited to $\Delta q$ in the entire input signal range. Thus, we have simplified the integer representation at the cost of doubling the maximum error magnitude and increasing the quantization noise by roughly 6dB. For having an integer representation and keeping the error magnitude limited to $\frac{\Delta q}{2}$, a mid-tread quantizer with an odd number of steps has to be used. It also has the advantage that zero-valued signals are tranformed to zero-valued output and the noise around zero is not inherently amplified to the magnitude $\Delta q/2$.