Source-linked AI summary

AudioTQ: A Data-Oblivious 6-Bit CPU Audio Codec via Randomized Hadamard Rotation and Lloyd-Max Quantization

Sahil Gangurde

arXiv:2608.15369v1cs.SDcs.AIcs.CR

TL;DR

Conventional audio codecs use computationally complex, domain-specific psychoacoustic and frequency-domain methods. AudioTQ instead applies randomized orthogonal rotation and quantization directly in the time domain, achieving 74.4% physical storage reduction with approximately 30 dB SQNR.

  • Problem

    Conventional lossy audio codecs reduce storage using computationally intensive psychoacoustic models, frequency-domain transforms, floating-point operations, and state tracking.

  • Method

    AudioTQ applies randomized sign multiplication and orthonormal FWHT rotation to Gaussianize time-domain audio before double-layer scalar quantization.

  • Results

    74.4% physical storage reduction and approximately 30 dB SQNR were achieved, alongside waveform cross-correlation above 99.95%.

  • Takeaways & Limitations

    AudioTQ demonstrates that data-oblivious quantization techniques developed for LLMs can be adapted to lightweight, zero-dependency time-domain audio compression on standard CPUs.

  • Takeaways & Limitations

    The data-oblivious rotation assumption fails when an input block aligns with a Walsh-Hadamard basis vector, causing severe distortion.

Abstract

from arXiv · show

Lossy audio compression algorithms traditionally rely on psychoacoustic modeling and frequency-domain representations (e.g., MP3, AAC, and Opus) to discard information that is imperceptible to the human auditory system. While highly effective, these approaches are computationally complex and domain-specific. In this paper, we present the design and mathematical formulation of AudioTQ, a data-oblivious lossy audio codec that operates directly in the time domain. Inspired by Large Language Model (LLM) weight quantization techniques (specifically the TurboQuant framework), AudioTQ uniformizes volatile time-domain amplitudes into a predictable standard normal distribution using an orthonormal, randomized Fast Walsh-Hadamard Transform (FWHT) rotation. This enables coordinate-wise scalar quantization using an offline-trained, MSE-optimal 6-bit Lloyd-Max quantizer, augmented by a 1-bit Quantized Joint Least-Squares (QJL) residual correction layer. The resulting 7-bit virtual indices are packed into native 8-bit containers, aligning with standard CPU register boundaries to ensure real-time single-threaded execution without hardware parallel accelerators. We detail the bitwise reconstruction of 24-bit studio stems, analyze the butterfly network of the FWHT, derive the mathematical failure modes under sparse inputs, and present benchmarks showing up to 74.4% physical size reduction alongside a Signal-to-Quantization-Noise Ratio (SQNR) of ~30 dB.

1 Introduction

AudioTQ addresses the bandwidth and storage demands of high-fidelity PCM audio by transferring data-oblivious, randomized-rotation quantization principles from LLM weight compression to time-domain audio. It shapes volatile audio amplitudes into a predictable N(0, 1) distribution without modeling human perception.

  • Motivation: Standard-fidelity PCM streams, including 16-bit CD and 24-bit studio audio, require substantial bandwidth and storage, motivating widespread lossy codec deployment.MP3, AAC, and Opus reduce data footprints by projecting signals into the frequency domain using MDCT.
  • Related work: LLM weight quantization methods address hardware memory constraints by reducing the precision of billion-parameter model weights.Examples include GPTQ, AWQ, and LLM.int8().
  • Related work: TurboQuant applies randomized orthogonal rotations data-obliviously to smooth outlier coordinates before mapping them to low-bit scalar codebooks.This property supports near-optimal distortion bounds for quantization.
  • Contribution: AudioTQ transfers these principles to time-domain audio by shaping arbitrary, volatile amplitude distributions into the standard normal distribution N(0, 1) without modeling human perception.The paper identifies structural symmetries between continuous audio amplitudes and neural-network weight matrices as volatile, high-dynamic-range numerical distributions.

2 Mathematical Framework and Input Processing

AudioTQ processes normalized PCM audio through input preparation, Gaussianization by randomized orthogonal rotation, and double-layer quantization, with decompression reversing these stages. Its rotation disperses transient and correlated amplitudes to support Gaussian-domain processing while preserving signal energy.

  • Input preparation: AudioTQ normalizes arbitrary integer PCM formats to single-precision amplitudes in [−1.0, 1.0], while 24-bit studio audio requires special handling because samples occupy 3-byte packets.The implementation groups raw WAV bytes into triplets, merges them into signed 32-bit integers, sign-extends the 24th bit, and normalizes the result.
  • Orthogonal rotation: AudioTQ applies static pseudo-random sign flips followed by an orthonormal Walsh-Hadamard rotation to scatter symmetric inputs and flatten transient spikes.For a block X ∈ R^B, B is a power of 2, and S = diag(s1, s2, . . . , sB) with si ∈ {−1, 1}.
  • Orthogonal rotation: O(B log B) execution uses an in-place butterfly network, with stage-dependent strides and coordinate updates performed without auxiliary transform storage.The transform has stages t = 1, . . . , log2 B and stride h = 2^(t−1).
  • Gaussianization: The final 1/√B scaling preserves Euclidean norm through Parseval’s relation, maintaining energy between time and rotated domains.Mixing samples across orthogonal basis functions drives rotated coefficients toward a zero-centered Gaussian distribution.
  • Gaussianization: AudioTQ removes the rotated block’s DC mean and standardizes centered coefficients to unit variance, while silent blocks bypass standardization and reconstruct as silence.A threshold guard prevents division-by-zero errors during silent passages.

3 Dual-Layer Quantization

AudioTQ standardizes rotated coefficients to N(0, 1) and applies two-stage quantization: an offline-trained 6-bit Lloyd-Max codebook followed by 1-bit QJL residual correction. This yields virtual 7-bit resolution with 128 reconstruction bins while adding 1 extra bit per sample.

  • Standardization: Standardization maps rotated coefficients in each active block to a standard normal distribution N(0, 1), enabling two-stage quantization.The standardized distribution provides the statistical consistency required by the quantization pipeline.
  • 6-bit Lloyd-Max Quantization: The first stage uses a 6-bit Lloyd-Max quantizer with 64 reconstruction levels, whose boundaries and centroids are trained offline to minimize MSE.Initialization uses standard normal samples and uniform quantiles, followed by 20 iterations of Lloyd’s algorithm.
  • QJL Residual Correction: Quantization to 64 discrete bins introduces rounding errors, which QJL represents using residual signs and a block-level MAE-derived scalar Δ.The scalar Δ is stored as block metadata and applied during decompression for sign-based correction.
  • QJL Residual Correction: 128 reconstruction bins provide virtual 7-bit quantization resolution at the cost of 1 extra bit per sample.The correction dynamically bisects each quantization bin according to the block’s residual scale.

4 Hardware Alignment and Serialization

AudioTQ aligns its serialized data with native CPU byte and register boundaries to support single-threaded real-time processing. Its packed representation reduces physical storage by 74.4% while enabling 1.35 MB/s decompression in pure Python and NumPy.

  • Hardware Alignment: Single-threaded real-time throughput is supported by aligning AudioTQ data structures with hardware register boundaries.Blocks contain B = 512 samples, with each block representing 2 KB of single-precision input that fits within typical 32–64 KB L1 data caches.
  • Serialization: The codec stores the 6-bit centroid index and 1-bit QJL flag in one native 8-bit byte container.The centroid index is shifted left by one bit, the QJL flag occupies the least significant bit, and the most significant bit is zero-padded.
  • Hardware Alignment: 1.35 MB/s decompression is achieved in pure Python and NumPy through the byte-aligned representation.The layout supports vectorized bitwise operations rather than packing across byte boundaries.
  • Serialization: 74.4% physical storage reduction results from representing each 512-sample block in 524 compressed bytes.The raw block is 2048 bytes, while packed data and metadata total 524 bytes.

5 Experimental Evaluation

AudioTQ was evaluated on voice and highly dynamic studio music using SQNR, Pearson cross-correlation, and peak envelope delta. The results show approximately 30 dB SQNR, 0.0002 peak envelope delta on studio tracks, and waveform cross-correlation above 99.95%, while refinements improved prototype limitations and reduced reconstruction noise.

  • 0.0002 peak envelope delta was achieved on studio tracks, with waveform cross-correlation above 99.95%.Fidelity was assessed using SQNR, Pearson Cross-Correlation (R), and peak envelope delta (δpeak).
  • ≈25.8 dB SQNR was obtained for standard 6-bit uniform quantization, versus ≈31.8 dB for 7-bit quantization at a typical 15 dB crest factor.Standard uniform quantization sizes steps for transient peaks, increasing quantization noise during lower-amplitude periods and introducing harsh clipping on transients.
  • ≈30 dB SQNR was achieved using randomized FWHT rotation with 6-bit Lloyd-Max quantization and a 1-bit QJL error layer.Rotation reduced the effective crest factor to approximately 3.0, or 9.5 dB, enabling operation near the theoretical Gaussian distortion limit without clipping distortion.
  • 24.6 dB was the approximate SQNR ceiling of early AudioTQ prototypes before three refinements were introduced.The refinements were an empirical Lloyd-Max solver, explicit mean centering, and QJL correction calibration.
  • 1.0 replaced the prototype’s 1.22× QJL residual multiplier, lowering the noise floor after the original setting overcorrected reconstruction.The 1.22× multiplier introduced high-frequency noise in the time domain.

6 Failure Mode Analysis

AudioTQ’s data-oblivious rotation fails when an input block aligns with a Walsh-Hadamard basis vector, concentrating energy into one coordinate and causing clipping. For B = 512 and α = 1.0, this sparsity-driven error reduces SQNR to 1.31 dB, while dynamic sign modulation and sub-LSB dithering offer safeguards.

  • Failure condition: FWHT energy-uniformization fails when the input block aligns with a Walsh-Hadamard basis vector.Under alignment, sign flipping preserves a basis vector, and orthogonality concentrates the transformed energy into one coordinate.
  • Quantization failure: 512 ≈ 22.63 exceeds the Lloyd-Max codebook’s ±2.41 centroid limits, so the concentrated coordinate is clipped.The quantizer is optimized for N(0, 1), making the sparse coordinate fall outside its supported centroid range.
  • Impact: 1.31 dB SQNR results from error propagation through the inverse transform, causing severe digital distortion across all samples.The failure is evaluated for B = 512 and normalized input α = 1.0.
  • Safeguards: 1 bit per 512 samples, or 0.002 bits per sample, enables dynamic sign modulation to break basis alignment after threshold detection.The encoder switches between two orthogonal sign matrices when |Yscaled,i| > 4.0 and records the choice in block metadata.
  • Safeguards: Sub-LSB triangular-distribution dithering disrupts exact basis symmetry, disperses the delta spike into a broad Gaussian noise floor, and prevents clipping.The pseudo-random noise is added before rotation.

7 Conclusion

AudioTQ adapts data-oblivious LLM quantization to time-domain audio compression, replacing psychoacoustic models with randomized coordinate rotations in a lightweight, zero-dependency codec for standard CPUs. Future work targets SIMD vectorization and sub-band frequency decomposition to improve compression throughput and fidelity.

  • Adaptation: AudioTQ adapts data-oblivious quantization techniques developed for Large Language Models to time-domain audio compression.The conclusion identifies this adaptation as the codec’s central demonstration.
  • Codec design: Replacing psychoacoustic models with randomized coordinate rotations yields a lightweight, zero-dependency codec optimized for standard CPUs.The design removes psychoacoustic modeling while retaining CPU-oriented operation.
  • Future work: Future work will investigate SIMD vectorization and sub-band frequency decomposition to further improve compression throughput and fidelity.Both directions are explicitly proposed as ways to improve the codec’s performance and output quality.
Loading 2608.15369v1…