/ concept-collection / timeseries-compressibility
Sign in
concept-collection / timeseries-compressibility
timeseries-compressibility / README.md
53 lines · 2.7 KBCodeBlameHistory
3Interactive exploration of how compressible quantized time series are.
5The generating model is: i.i.d. Gaussian noise (std σ, measured in quantization
43704d2Clear the analytic rate: R now comes from the timeseries-entropy estimatorJeremy Magland 6steps) → FIR filter → round to integers. The app shows the filter (convolution
7kernel and frequency response, with cutoffs in Hz against a chosen sample
8rate), a window of the generated integer signal (stationary by default, with a
9play toggle to let it stream endlessly), and the measured compression of a
10block of the generated integers under nine methods — zlib, zstd, and an rANS
11entropy coder, each raw, delta-coded, and LPC-residual-coded — as bits per
12sample and as ratio against raw int16 storage. The predictor order and the
13block size are controls, so the measurement can be pushed from 10k to a million
14samples and LPC from order 1 to 128. Each prefilter group also carries a hollow
15bar: the order-0 entropy of the stream being coded, the limit a per-sample
16entropy coder cannot beat, which ANS misses by 1–2% (its symbol table plus its
17own arithmetic loss).
19The reference rate R — the entropy rate of the process, the bits/sample limit
20no lossless method can beat — comes from the companion
21[timeseries-entropy](https://github.com/concept-collection/timeseries-entropy)
22package: an unbiased Monte-Carlo estimator of H(z_next | a long past), by Gibbs
23sampling the latent Gaussian under the rounding constraints and applying
24Rhee–Glynn randomized telescoping to the sampled chain. The app shows the exact
25command to run it at the current settings; estimating R in the browser is
26planned, and until then the UI shows a placeholder for it.
28## Run it
30```sh
31npm install
32npm run dev
33```
35## Layout
37```
5bab85aRatio-first chart, quantization-floor theory formula, line-segment view, fixed latent dataJeremy Magland 38src/model/ the latent source (fixed seeded randomness indexed by sample
43704d2Clear the analytic rate: R now comes from the timeseries-entropy estimatorJeremy Magland 39 position, convolved zero-phase with the kernel on demand)
40 and the FIR presets
36e8ceaInteractive explorer for compressibility of quantized filtered Gaussian time seriesJeremy Magland 41src/compress/ lossless codecs run in the browser: zlib (fflate), zstd (wasm),
42 ans.ts (a bit-identical port of simple_ans), and FLAC-style
43 integer LPC; borrowed from entropy-quantized-linear-transform
44src/worker/ the codecs run off the main thread on a debounced parameter set
43704d2Clear the analytic rate: R now comes from the timeseries-entropy estimatorJeremy Magland 45src/components/ controls, filter plots, signal canvas, compression chart,
46 and the reference-rate method note
49Every 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 50decoder needs (ANS symbol table, LPC coefficients). The signal view and the
51compression block read the same fixed latent noise sequence — parameter changes
52transform the same underlying data rather than resampling it, and the first
53window shown is the start of the block that gets compressed.
moveopenescclose