-
Notifications
You must be signed in to change notification settings - Fork 74k
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
contrib STFT magnitudes different to librosa's #15134
Comments
@rryan do you know anything about that? |
I was talking to a friend about this and he tested a bunch of prominent FFT libraries such as FFTW, and he noted that the output was different for those. So maybe its to be expected across implementations. Just wanted to let you know at any rate. |
The difference is probably due to the window function. By default librosa uses the hann window function. You can do similar in tensorflow with the following. I have not tested your code to see if this actually does make it the same.
|
What version of librosa are you comparing to? Given the date of the post, I'm assuming <=0.5.1. We recently fixed a long-standing, inherited bug where the stft was incorrectly conjugated, so that might also contribute to discrepancies. The fix was included in librosa 0.6, see this thread for an explanation of what happened there. It's also worth checking magnitude ratios, instead of absolute differences, just to see if it's a factor of |
Howdy! @fedden Did you conclude that the TensorFlow's contrib STFT library is good to go? Are you using it or the librosa one? |
Hi! Thank you @fedden for the helpful repro. One difference between librosa and I think that accounts for the difference here. I put your repro in a Colab notebook and set |
This issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Thank you. |
Closing as stale. Please reopen if you'd like to work on this further. |
System information
Hi all!
I was comparing the TensorFlow's contrib STFT against librosa's and noticed there are some discrepancies in terms of output between the two. Not sure if this normal between libraries implementations, but I wanted to raise it in case it matters!
I'm also aware it could be some small bug or difference in implementation/argument that I have supplied.
Code:
And the expected output from the print would be:
The text was updated successfully, but these errors were encountered: