feat(fft): implement 1D FFT/IFFT and frequency helpers - #232
feat(fft): implement 1D FFT/IFFT and frequency helpers#232sonusharma6-dsa wants to merge 6 commits into
Conversation
Signed-off-by: sonusharma6-dsa <ramprashadkumar11@gmail.com> (cherry picked from commit 7bbd6db) Signed-off-by: sonusharma6-dsa <ramprashadkumar11@gmail.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds 1-D ChangesCore FFT + Frequency Utilities
Sequence Diagram (high-level FFT flow)sequenceDiagram
participant Client as Caller
participant TransformFn as fft/ifft
participant Planner as rustfft::FftPlanner
participant Executor as rustfft::Fft
participant Scaler as Norm scaling
participant Output as Vec<Complex<f64>>
Client->>TransformFn: call with input & optional n, norm
TransformFn->>Planner: plan forward/inverse FFT for len n
TransformFn->>Executor: execute plan on prepared buffer
Executor->>Scaler: apply forward/inverse normalization
Scaler->>Output: produce Vec<Complex<f64>>
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Signed-off-by: sonusharma6-dsa <ramprashadkumar11@gmail.com>
|
Addressed CI review comments: added zero-length guards to ft/ifft and fixed |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/mohu-fft/src/freq.rs`:
- Around line 12-17: The fftfreq generation currently includes index n_half in
the positive branch causing the Nyquist term to be +0.5/d for even n; change the
logic so the positive loop runs 0..n_half (exclusive) and the negative branch
covers n_half..n, or explicitly handle the i==n_half case when n%2==0 to push
-((n - i) as f64) * val for that index; update the loops that reference n_half,
freqs, val and n (or add a conditional for even n) so the Nyquist frequency is
negative for even lengths.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: fde56ce6-b7ef-481d-8019-72936a0aadb2
📒 Files selected for processing (2)
crates/mohu-fft/src/freq.rscrates/mohu-fft/src/transform.rs
Signed-off-by: sonusharma6-dsa <ramprashadkumar11@gmail.com>
|
Fixed fftfreq Nyquist sign for even |
…ssary casts) Signed-off-by: sonusharma6-dsa <ramprashadkumar11@gmail.com>
|
Addressed several Clippy/format items: removed empty line after doc comments in macros.rs, implemented FromStr for DType, and removed unnecessary casts in info.rs. Pushed signed commit. |
Signed-off-by: sonusharma6-dsa <ramprashadkumar11@gmail.com>
|
CI: added cargo-machete ignore metadata for mohu-fft to silence unused-deps false positives while implementation is partial. Pushed signed commit. Continuing to address Clippy/Format items. |
…and fft modules Signed-off-by: sonusharma6-dsa <ramprashadkumar11@gmail.com>
|
Formatting fixes pushed (applied rustfmt-like adjustments to reporter, test_utils, and fft modules). Please re-run checks. |
Implements basic 1D FFT/IFFT and frequency helpers (fftfreq, fftshift). Rebased onto upstream/main to fix DCO. Fixes #225.
Summary by CodeRabbit
New Features
Tests
Chores