question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

scipy.signal.stft (and istft)

See original GitHub issue

STFT plays a vital role in audio/ speech signal processing, and it would be nice to have jax-version of scipy.signal.stft function. As Jax already has auto-differentiable FFT and conv1d, it can be basically a utility function that combines those two.

It would be nice if we can have SciPy-compatible STFT function in Jax.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
yotarokcommented, Feb 3, 2022

Hi @machineko, and @hawkinsp,

I think having the extra outputs in “scipy.stft” is not significan because JIT can effectively omit computation of those if we just didn’t use those outputs. And, “reflect”-paddings in librosa are implemented in scipy.stft too when boundary=“even” is provided.

So, overall, I prefer strictly maintaining scipy.stft interface if we are to put the code in Jax repo. Here’s a proposal PR. https://github.com/google/jax/pull/9422

Any feedbacks are welcome!

1reaction
hawkinspcommented, Feb 2, 2022

If JAX functions are named like jax.scipy.XYZ they should try to mimic the scipy API. If they diverge, then that’s fine, but they should be called something else. What changes did you have in mind?

Read more comments on GitHub >

github_iconTop Results From Across the Web

scipy.signal.istft — SciPy v1.9.3 Manual
This function implements the iSTFT via the least-squares estimation algorithm detailed in [2], which produces a signal that minimizes the mean squared error ......
Read more >
Invertible STFT and ISTFT in Python - scipy - Stack Overflow
For this example, I use a naive overlap-and-add method in istft . In order to reconstruct the original signal the sum of the...
Read more >
SciPy Signal STFT - Seminar 02 Support Material - YouTube
Spectrograms Basics - SciPy Signal STFT - Seminar 02 Support Material - Multirate Signal Processing SeminarsGitHub: ...
Read more >
librosa.core.istft
a window specification (string, tuple, or number); see scipy.signal. ... D = librosa.stft(y) >>> y_hat = librosa.istft(D) >>> y_hat array([ -4.812e-06, ...
Read more >
jax.scipy.signal.istft - JAX documentation - Read the Docs
LAX-backend implementation of scipy.signal._spectral_py.istft() . Original docstring below. Parameters. Zxx (array_like) – STFT of the signal to be ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found