-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Added Short time fourier transform and ISTFT implementations #2074
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
I referred to librosa's documentation on stft to write my implementation: and Pytorch's documentation: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks well done from a first pass.
The main question to answer is whether this should be in the main mlx vs on a per library/use case implementation. I also think this shouldn't be in the top level of the package. We should come up with a better location if we are to merge this (I don't have a very good suggestion atm).
Regarding the PR content, I would definitely add docstrings and tests for the two functions.
@angeloskath would adding to the code to the utils.py be a better option ? |
One option is to go the route of cloning scipy in MXL kind of like Jax (e.g. put this in a new package Another option is to put this in |
Okay, I would implement a C++ version of this and add it to mlx.core.fft |
@awni should I create a separate namespace for this ?? |
in fft.cpp |
@awni @angeloskath I have added a C++ implementation of stft in mlx.core.fft i.e. fft.cpp file. Can you please review it ?? |
The next step is to remove the Python one and make a binding in python/src/fft.cp |
@awni I have added bindings and also removed the python implementation |
This PR is missing tests. |
@awni can you please review this PR ? |
I have added all the fixes and tests |
@awni I fixed the headers. Compiled and tested it and it works fine on my end. |
@awni can you please review this PR ? |
@awni @angeloskath ??? |
Proposed changes
Please include a description of the problem or feature this PR is addressing. If there is a corresponding issue, include the issue #.
This PR introduces the implementations of Short Time and Inverse Short Time Fourier Transforms in mlx as addressed in issue #1004
Fixes #1004
Checklist
Put an
x
in the boxes that apply.pre-commit run --all-files
to format my code / installed pre-commit prior to committing changes