AlexanderLutsenko/nobuco

FFT/STFT support

Opened this issue · 1 comments

I found that 2D FFT and IFFT are implemented but 1D FFT and IFFT are not, as well as STFT and ISTFT, which are very important tool in audio signal area. It would be great if nobuco can support them. Thank you for the great work!

Unimplemented nodes:
 I  File "/home/user/miniconda3/envs/mss/lib/python3.10/site-packages/nobuco/trace/trace.py", line 460 
 D  File "/home/user/workspace/test/test.py", line 224  
MyModel[model](float32_0<1,2,32256>) -> float32_7<1,2,2,32256>
 │   I  File "/home/user/workspace/test/model.py", line 89 
 │  angle[torch](complex64_1<1,2,1025,64>) -> float32_2<1,2,1025,64>
 │   I  File "/home/user/workspace/test/model.py", line 283 
 │   D  File "/home/user/workspace/test/model.py", line 320  
 ├· ISTFT[model](complex64_3<1,2,2,1025,64>) -> float32_7<1,2,2,32256>
 │   │   I  File "/home/user/workspace/test/model.py", line 331 
 └   │  istft[torch](complex64_4<4,1025,64>, window=float32_5<2048>, n_fft=2048, hop_length=512, win_length=2048, center=True) -> float32_6<4,32256>

torch.stft and istft are equivalent to tf.signal.stft and tf.signal.inverse_stft

Hi! I added some experimental support for STFT/ISTFT (as well as 1D and 2D FFT/IFFT) in v0.14.7, which you can test here. It's not perfect, ISTFT breaks with windows containing zeros (e. g. Hann window). Let me know if you find a way around that.