1
$\begingroup$

I'm trying to implement this paper in tensorflow and keras. At the end of section 3 it says.

Note that although weighted SDR loss is a time-domain loss function,
it can be backpropagated through our framework.
Specifically, STFT and ISTFT operations are implemented as 1-D convolution
and deconvolution layers consisting of fixed filters initialized 
with the discrete Fourier transform matrix.

How would I go about implementing an STFT and an ISTFT as a 1-D convolution and 1-D deconvolution respectively? For example how would the window size and the hop length correspond to parameters of a convolution?

Conversely, could I just use tensorflow's built in STFT and inverse_STFT ops instead?

$\endgroup$
2
$\begingroup$

I found an implementation of STFT based on conv1d in pytorch here:

https://github.com/huyanxin/phasen/blob/master/model/conv_stft.py

edit: Actually, the phasen repository took the STFT code from https://github.com/pseeth/torch-stft edit2: Asteroid has an alternative implementation of STFT and iSTFT: https://github.com/mpariente/asteroid/

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.