Skip to content

Use the fft-correlation crate for FFT cross-correlation (0.4.3) - #53

Merged
andrewchen5678 merged 3 commits into
mainfrom
use-fft-correlation-crate
Oct 7, 2026
Merged

andrewchen5678 merged 3 commits into
mainfrom
use-fft-correlation-crate

Conversation

@andrewchen5678

Copy link
Copy Markdown
Collaborator

Summary

  • Drop the inlined copy of fft-correlation (dsp/correlate.rs) that the Rust rewrite introduced and depend on the fft-correlation crate again (git tag v0.0.6). The workspace/template caching that had been added here now lives in that crate.
  • Pick up its FFT sizing: the smallest m * 2^k (m in 1, 3, 5, 9, 15) covering the correlation instead of the next power of two, which doubled the FFT for clips longer than about 2.5 s at the default 60 s chunk.
  • Error gains a Correlation variant, raised as RuntimeError from the Python bindings.
  • Docs updated for the crate and the sizing; bump version to 0.4.3.

Testing

  • cargo clippy --all-targets -- -D warnings, also with the python feature
  • cargo test --locked
  • Python binding tests
  • Old vs new binary on two hours of 8 kHz audio, interleaved rounds: detections byte-identical; 5.4–5.9 s → 4.8–5.2 s with three patterns of mixed length, no change for a single short clip

🤖 Generated with Claude Code

Andrew Chen and others added 3 commits October 6, 2026 22:16
The Rust rewrite inlined a copy of fft-correlation as dsp/correlate.rs.
Drop the copy and depend on the crate again; the workspace/template
caching that had been added here now lives there, together with FFT
sizes of the form m * 2^k (m in 1, 3, 5, 9, 15) instead of the next
power of two. Detections are unchanged on two hours of 8 kHz audio and
runs with mixed clip lengths are about 12% faster.

- Error gains a Correlation variant (RuntimeError in Python).
- The dependency is an interim path reference to a sibling checkout of
  fft-correlation (0.0.6, unreleased). It does not resolve in CI and
  must become a git tag dependency once that version is tagged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace the interim path reference to a sibling checkout with a git tag
dependency, now that v0.0.6 is released, so the build resolves in CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@andrewchen5678
andrewchen5678 merged commit da77f59 into main Oct 7, 2026
2 checks passed
@andrewchen5678
andrewchen5678 deleted the use-fft-correlation-crate branch October 7, 2026 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant