-
-
Notifications
You must be signed in to change notification settings - Fork 124
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
Implement Short-time Fourier transform and its inverse #587
Conversation
I'm not sure if NNlib.jl is the right place for audio stuff. But I figured since torch has it, we can too, for convenience |
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.
Looks pretty good to me. The only thing might be adding some basic gradient tests. The bulk of gradient testing is already in AbstractFFTs.
src/audio/spectrogram.jl
Outdated
|
||
julia> spec_db = NNlib.power_to_db(spec); | ||
|
||
julia> Makie.heatmap(spec_db[:, :, 1]) |
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.
Maybe a UnicodePlot with output would be nicer here (and fit other docstrings in NNlib)
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.
See output for UnicodePlot for heatmap: https://fluxml.ai/NNlib.jl/previews/PR587/audio/#Spectrogram
Not sure how I feel about it. Maybe it is worth switching to Plots.jl?
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.
Yeah it's not ideal, but my inclination towards UnicodePlots is so that docstrings render completely in the REPL as well. I'm happy to use Makie or Plots instead though.
Let's solicit opinions from @mcabbott or @ToucheSir.
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.
- Convert examples to doctests or evaluate during build time -More tests
I've addressed comments. I think we also need higher level API in future, like |
@darsnack, kind bump |
Project.toml
Outdated
@@ -6,6 +6,7 @@ version = "0.9.17" | |||
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" | |||
Atomix = "a9b6321e-bd34-4604-b9c9-b65b8de01458" | |||
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" | |||
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341" |
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.
Can we make this a weak dependence and move any function relying on FFTW under an extension?
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.
Done
test/Project.toml
file and install GPU backends only when testing them.Currrently latest CUDA does not support LLVM 7, but AMDGPU uses only it. Without this fix, we can't install all packages needed for testing.
spectrogram
and conversion from power to decibel (power_to_db
) units and vice versa (db_to_power
).Spectrogram Example:
PR Checklist