Skip to content

Add fftfreq, rfftfreq and scalar axes for fftshift/ifftshift#3298

Merged
angeloskath merged 5 commits into
ml-explore:mainfrom
declanhealy2:fftfreq-and-scalar-axes
Apr 1, 2026
Merged

Add fftfreq, rfftfreq and scalar axes for fftshift/ifftshift#3298
angeloskath merged 5 commits into
ml-explore:mainfrom
declanhealy2:fftfreq-and-scalar-axes

Conversation

@declanhealy2

@declanhealy2 declanhealy2 commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

Proposed changes

Add fftfreq and rfftfreq to mlx.core.fft, and allow fftshift/ifftshift to accept a scalar int for the axes parameter to match NumPy's API.

Checklist

  • I have read the CONTRIBUTING document
  • I have run pre-commit run --all-files to format my code / installed pre-commit prior to committing changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the necessary documentation (if needed)

@angeloskath

Copy link
Copy Markdown
Member

That looks good but can you add it to the C++ side as well and then call it from python?

@declanhealy2

Copy link
Copy Markdown
Contributor Author

Thanks for looking at this. Have now moved fftfreq and rfftfreq to the C++ side.

@angeloskath angeloskath left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. I 'll merge after the tests pass.

@angeloskath angeloskath merged commit 2105df9 into ml-explore:main Apr 1, 2026
16 checks passed
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.

3 participants