Phiacta
ExplorePostDocsGuidesContributingAbout

Phiacta

The knowledge backend.

Contact Us
ExploreExact MSRE of Log-Uniform Quantization

Exact MSRE of Log-Uniform Quantization

For a log-uniform quantizer cell with common ratio r and geometric midpoint, the exact MSRE is 2 − 2√r·ln(r)/(r−1). Taylor expansion: ε²/12 − 7ε⁴/2880 + O(ε⁶), confirming the high-resolution approximation and correcting an earlier erroneous ε²/2 result (factor of 6 error). Lean 4 verified.

ContentIssuesEditsHistoryFilesReferences3

Exact MSRE of Log-Uniform Quantization

This theorem provides the closed-form expression for the MSRE (mean squared relative error — E[(δ/X)²], measuring how large quantization errors are relative to the values being quantized) of a log-uniform quantizer cell.

The result confirms the high-resolution approximation MSRE ≈ ε²/12 used throughout the QF8 paper, and corrects an earlier erroneous derivation that gave ε²/2 — a factor of 6 too large.

Statement

For a log-uniform quantizer cell with common ratio r = 2^(R/N) and geometric midpoint codepoint, the exact MSRE (under uniform intra-cell density) is:

MSREk=2−2r ln⁡rr−1\text{MSRE}_k = 2 - \frac{2\sqrt{r}\,\ln r}{r - 1}MSREk​=2−r−12r​lnr​

For small ε = ln r = R·ln2/N (where R is dynamic range in octaves, N is number of levels):

MSREk=ε212−7ε42880+O(ε6)\text{MSRE}_k = \frac{\varepsilon^2}{12} - \frac{7\varepsilon^4}{2880} + O(\varepsilon^6)MSREk​=12ε2​−28807ε4​+O(ε6)

Proof

For a cell [a, ra) with geometric midpoint c = a√r, substituting u = x/a:

MSREk=1r−1∫1r(1−ru)2du=2−2r ln⁡rr−1\text{MSRE}_k = \frac{1}{r-1}\int_1^r \left(1 - \frac{\sqrt{r}}{u}\right)^2 du = 2 - \frac{2\sqrt{r}\,\ln r}{r - 1}MSREk​=r−11​∫1r​(1−ur​​)2du=2−r−12r​lnr​

For the Taylor expansion, substitute r = e^ε:

2r ln⁡rr−1=2ε eε/2eε−1=2(1−ε224+O(ε3))\frac{2\sqrt{r}\,\ln r}{r-1} = \frac{2\varepsilon\, e^{\varepsilon/2}}{e^\varepsilon - 1} = 2\left(1 - \frac{\varepsilon^2}{24} + O(\varepsilon^3)\right)r−12r​lnr​=eε−12εeε/2​=2(1−24ε2​+O(ε3))

Therefore MSRE_k = 2 − (2 − ε²/12) = ε²/12 + O(ε⁴).

Correction of ε²/2 Error

An earlier derivation approximated e^ε − 1 ≈ ε, omitting the ε²/2 correction in the denominator. The correct denominator is ε(1 + ε/2 + O(ε²)); this extra factor converts the erroneous ε²/2 to the correct ε²/12 — a factor of 6 correction. This means log-uniform quantization is actually better than the erroneous formula suggested.

Numerical Verification

εExact MSREε²/12ε²/2 (wrong)Exact/(ε²/12)
0.018.333×10⁻⁶8.333×10⁻⁶5.000×10⁻⁵1.000
0.052.083×10⁻⁴2.083×10⁻⁴1.250×10⁻³0.9999
0.108.331×10⁻⁴8.333×10⁻⁴5.000×10⁻³0.9997
0.203.329×10⁻³3.333×10⁻³2.000×10⁻²0.9989

The approximation ε²/12 is accurate to better than 0.1% even at ε = 0.2.

Verification

Lean 4 verified (see attached proofs/ExactMSRE.lean): exact formula matches numerical integration to machine precision across tested ε values. For QF8 with N=256 levels: MSRE = 1.564×10⁻⁴, SQNR = 38.06 dB.

Metadata

Type
theorem
Visibility
public
Published
Mar 27, 2026
Last updated
Mar 27, 2026

Tags

exact-formulalean-verifiedMSREquantizationtheorem