Skip to content

feat: add DIT FFT algorithm & bit reversal control#37

Merged
smu160 merged 7 commits intomainfrom
feature/DIT-FFT-AND-Bit-Reversal-Control
Sep 6, 2025
Merged

feat: add DIT FFT algorithm & bit reversal control#37
smu160 merged 7 commits intomainfrom
feature/DIT-FFT-AND-Bit-Reversal-Control

Conversation

@smu160
Copy link
Member

@smu160 smu160 commented Sep 3, 2025

add DIT FFT algorithm & bit reversal control

This PR introduces two major enhancements to PhastFT:

  1. DIT (Decimation-in-Time) FFT algorithm - A complete alternative implementation to the
    existing DIF algorithm
  2. Bit reversal control for DIF - Allows users to skip bit reversal for better performance
    when chaining operations

Changes

DIT FFT Implementation

  • Complete DIT algorithm for both f32 and f64 precision
  • Optimized SIMD kernels for chunk sizes 8, 16, 32, and 64
  • Dedicated planners with pre-computed twiddle factors
  • Runtime CPU feature detection via multiversion

Bit Reversal Control

  • New Options::dif_perform_bit_reversal flag
  • Conditional bit reversal in DIF algorithms
  • Maintains backward compatibility (defaults to true)
  • Note: this only affects DIF, not DIT

API Additions

pub fn fft_32_dit(reals: &mut [f32], imags: &mut [f32], direction: Direction)
pub fn fft_64_dit(reals: &mut [f64], imags: &mut [f64], direction: Direction)
pub fn fft_32_dit_with_planner(...)
pub fn fft_64_dit_with_planner(...)
pub fn fft_32_dit_with_planner_and_opts(...)
pub fn fft_64_dit_with_planner_and_opts(...)

@codecov-commenter
Copy link

codecov-commenter commented Sep 3, 2025

Codecov Report

❌ Patch coverage is 95.51282% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.22%. Comparing base (aa296ba) to head (c4450a9).

Files with missing lines Patch % Lines
src/algorithms/dit.rs 78.18% 24 Missing ⚠️
src/algorithms/dif.rs 50.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #37      +/-   ##
==========================================
- Coverage   99.12%   97.22%   -1.90%     
==========================================
  Files           8       12       +4     
  Lines         683     1225     +542     
==========================================
+ Hits          677     1191     +514     
- Misses          6       34      +28     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@smu160 smu160 merged commit bff1027 into main Sep 6, 2025
8 checks passed
@smu160 smu160 deleted the feature/DIT-FFT-AND-Bit-Reversal-Control branch September 6, 2025 21:31
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.

2 participants