36e8ceaInteractive explorer for compressibility of quantized filtered Gaussian time seriesJeremy Magland 1# timeseries-compressibility
3Interactive exploration of how compressible quantized time series are.
5The generating model is: i.i.d. Gaussian noise (std σ, measured in quantization
6steps) → FIR filter → optional additive uniform dither on [-½, ½) → round to
7integers. The app shows the filter (convolution kernel and frequency response,
eb36f3fMake the signal view stationary by default with a play toggleJeremy Magland 8with cutoffs in Hz against a chosen sample rate), a window of the generated
9integer signal (stationary by default, with a play toggle to let it stream
10endlessly), and the measured compression of a 120,000-sample
36e8ceaInteractive explorer for compressibility of quantized filtered Gaussian time seriesJeremy Magland 11block under nine methods — zlib, zstd, and an rANS entropy coder, each raw,
12delta-coded, and LPC-residual-coded — as bits per sample and as ratio against
13raw int16 storage.
5bab85aRatio-first chart, quantization-floor theory formula, line-segment view, fixed latent dataJeremy Magland 15Alongside the measurements it plots a theoretical bits/sample R: quantization
16is modeled as an additive white noise floor on the spectrum, the one-step
17Wiener prediction error of the resulting process comes from the
18Szegő–Kolmogorov formula, and R is the exact entropy of that innovation
19quantized at unit step:
36e8ceaInteractive explorer for compressibility of quantized filtered Gaussian time seriesJeremy Magland 20
21```
5bab85aRatio-first chart, quantization-floor theory formula, line-segment view, fixed latent dataJeremy Magland 22S_z(f) = σ²|H(f)|² + σ_q² σ_q² = 1/12 (1/6 with dither)
23σ_e² = exp( 2 ∫₀^½ ln S_z(f) df )
24R = H_Δ(σ_e) (exact quantized-Gaussian entropy)
36e8ceaInteractive explorer for compressibility of quantized filtered Gaussian time seriesJeremy Magland 25```
5bab85aRatio-first chart, quantization-floor theory formula, line-segment view, fixed latent dataJeremy Magland 27Where the spectrum sits well above one step² this reduces to the classical
28Gaussian entropy rate ½log₂(2πe) + ∫log₂S df; the noise floor keeps it finite
29and positive where a deep stopband would send that integral to −∞. LPC + ANS
30should approach R; probing where the approximation holds is the point. The
31math section is a stub for the full derivation.
36e8ceaInteractive explorer for compressibility of quantized filtered Gaussian time seriesJeremy Magland 32
33## Run it
35```sh
36npm install
37npm run dev
38```
40## Layout
42```
5bab85aRatio-first chart, quantization-floor theory formula, line-segment view, fixed latent dataJeremy Magland 43src/model/ the latent source (fixed seeded randomness indexed by sample
44 position, convolved zero-phase with the kernel on demand),
45 FIR presets, and the theoretical-rate formula
36e8ceaInteractive explorer for compressibility of quantized filtered Gaussian time seriesJeremy Magland 46src/compress/ lossless codecs run in the browser: zlib (fflate), zstd (wasm),
47 ans.ts (a bit-identical port of simple_ans), and FLAC-style
48 integer LPC; borrowed from entropy-quantized-linear-transform
49src/worker/ the codecs run off the main thread on a debounced parameter set
5bab85aRatio-first chart, quantization-floor theory formula, line-segment view, fixed latent dataJeremy Magland 50src/components/ controls, filter plots, signal canvas, compression chart
36e8ceaInteractive explorer for compressibility of quantized filtered Gaussian time seriesJeremy Magland 51```
53Every reported size round-trips through the decoder and includes whatever the
5bab85aRatio-first chart, quantization-floor theory formula, line-segment view, fixed latent dataJeremy Magland 54decoder needs (ANS symbol table, LPC coefficients). The signal view and the
55compression block read the same fixed latent noise sequence — parameter changes
56transform the same underlying data rather than resampling it, and the first
57window shown is the start of the block that gets compressed.