Skip to content

[Autoloop: build-tsb-pandas-typescript-migration] Iteration 387: Add signal processing and digital filters#363

Draft
github-actions[bot] wants to merge 2 commits into
mainfrom
autoloop/build-tsb-pandas-typescript-migration
Draft

[Autoloop: build-tsb-pandas-typescript-migration] Iteration 387: Add signal processing and digital filters#363
github-actions[bot] wants to merge 2 commits into
mainfrom
autoloop/build-tsb-pandas-typescript-migration

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

This PR adds two new signal processing modules to src/stats/:

signal.ts — FFT, STFT, Welch PSD

  • FFT/IFFT/RFFT/IRFFT: Cooley-Tukey radix-2 DIT iterative algorithm (non-power-of-2 inputs zero-padded)
  • Frequency utilities: fftFreq, rfftFreq, fftshift, ifftshift
  • Window functions: rectangular, bartlett, hann, hamming, blackman, blackmanharris, flattop, kaiser + getWindow factory
  • STFT/ISTFT: overlap-add reconstruction, configurable window/hop
  • Welch PSD: mean/median averaging, one-sided/two-sided output
  • Periodogram: standard power spectral density estimate

filters.ts — FIR, Butterworth IIR

  • firwin: FIR filter design via windowed-sinc (lowpass/highpass/bandpass/bandstop)
  • butter: Butterworth IIR design in SOS form (lowpass/highpass/bandpass/bandstop)
  • Frequency response: freqz (single-section), sosfreqz (SOS cascade)
  • Filter application: lfilter (causal), filtfilt (zero-phase, double-pass), sosfilt, sosfiltfilt

Files Changed

  • src/stats/signal.ts — new (~600 lines)
  • src/stats/filters.ts — new (~450 lines)
  • tests/stats/signal.test.ts — new (~300 lines, unit + property-based)
  • tests/stats/filters.test.ts — new (~280 lines, unit + property-based)
  • playground/signal.html — new interactive tutorial
  • playground/filters.html — new interactive tutorial
  • src/stats/index.ts, src/index.ts — updated exports
  • playground/index.html — feature cards added

Metric

183 → 185 (+2 TypeScript source files with exports)


Generated by Autoloop — Iteration 387
Run: https://github.com/githubnext/tsb/actions/runs/28396990118

Generated by Autoloop · ● 85.2M ·

…signal processing (FFT/STFT/Welch) and digital filters (FIR/Butterworth)

- src/stats/signal.ts: Cooley-Tukey radix-2 DIT FFT/IFFT/RFFT/IRFFT,
  fftFreq/rfftFreq, fftshift/ifftshift, 8 window functions (getWindow),
  STFT/ISTFT (overlap-add), Welch PSD (mean/median), periodogram.
  Mirrors numpy.fft + scipy.signal spectral utilities.
- src/stats/filters.ts: FIR design via windowed-sinc (firwin), Butterworth
  IIR design (butter, SOS form), frequency response (freqz, sosfreqz),
  filter application (lfilter, filtfilt, sosfilt, sosfiltfilt).
  Mirrors scipy.signal filter utilities.
- tests/stats/signal.test.ts: 50+ tests (unit + property-based)
- tests/stats/filters.test.ts: 50+ tests (unit + property-based)
- playground/signal.html, playground/filters.html: interactive tutorials
- playground/index.html, src/stats/index.ts, src/index.ts: updated exports

Metric: 183 → 185 (+2)

Run: https://github.com/githubnext/tsb/actions/runs/28396990118

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ORC file format I/O (readOrc / toOrc)

Implement Apache ORC (Optimized Row Columnar) file format reader and writer.

- src/io/orc.ts: Full ORC implementation (~1200 lines)
  - Protobuf decoder/encoder (LSB-first varints, wire types 0/1/2/5)
  - Hadoop VInt reader/writer (MSB-first big-endian, Hadoop-style encoding)
  - RLE byte v1 encoder/decoder (PRESENT/BOOLEAN streams)
  - RLE integer v1 encoder/decoder (INT/LONG columns)
  - Column encoders: BOOLEAN, INT/LONG, FLOAT/DOUBLE, STRING
  - Full null support via ORC PRESENT stream
  - readOrc(data, options) and toOrc(df, options) exported functions
- tests/io/orc.test.ts: Comprehensive test suite with fast-check property tests
- playground/orc.html: Interactive tutorial page

Metric: 185 → 186

Run: https://github.com/githubnext/tsb/actions/runs/28429568433

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor Author

Commit pushed: 4bc79cc

Generated by Autoloop · ● 81.8M

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

0 participants