Open happyTonakai opened 9 months ago
It seems that the reason is the first sample of Hann window is zero. When I use torch.ones(nfft)
or torch.hamming_window(nfft)
, it will be ok.
This error means that the window coverage is not enough to fully recover the original signal.
Specifically in this example, when using center=False
, the first element of the output waveform is calculated as res[0] = something / window[0]
. However, window[0]
is 0
when hamming_window
is used, which results in an error when calculating res[0]
.
🐛 Describe the bug
Issue Description:
I encountered an issue when using the
torch.istft
function in PyTorch. It seems to be related to the window overlap add and produces the following error message:Steps to Reproduce:
To reproduce the issue, you can use the following minimal working example:
It works fine when
center=False
. It seems that someone else also had this problem.Thank you for your assistance in resolving this issue.
Versions
cc @mruberry @peterbell10