Skip to content

feat: Add FFT, DCT, and window functions - #17

Merged
CodeWithKyrian merged 1 commit into
mainfrom
feat/signal-fourier-dct-windows
Apr 22, 2026
Merged

CodeWithKyrian merged 1 commit into
mainfrom
feat/signal-fourier-dct-windows

Conversation

@CodeWithKyrian

Copy link
Copy Markdown
Contributor

Summary

This PR introduces signal-processing functionality to NDArray: complex and real FFTs, multi-dimensional transforms, discrete cosine transforms (types I–IV) with SciPy-style normalization options, and a library of window generators.

Motivation and context

Scientific computing workflows in PHP need the same foundational building blocks common in NumPy/SciPy: frequency-domain transforms with well-defined normalization conventions, robust inverse pairings, and standard tapering windows for spectral analysis and filtering-style pipelines. This PR adds those capabilities in a performance-oriented way (Rust + FFI) while keeping the PHP API explicit and testable.

What’s changed

  • Added complex FFT/IFFT (1D and N‑D) and 2D helpers.
  • Added real FFT / inverse real FFT with Hermitian-spectrum → real output behavior.
  • Added DCT I–IV and inverse DCT with correct type pairing, including 1D, 2D, and N‑D variants.
  • Added static window factories on NDArray (Bartlett, Blackman, Bohman,ming, Hanning/Lanczos, Triangular, Kaiser) with a symmetric/periodic option where applicable.
  • Added new tests and documentation to cover the new functionality.

Breaking changes

None.

@CodeWithKyrian
CodeWithKyrian merged commit 537fe16 into main Apr 22, 2026
14 checks passed
@CodeWithKyrian
CodeWithKyrian deleted the feat/signal-fourier-dct-windows branch April 22, 2026 00:38
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