-
Notifications
You must be signed in to change notification settings - Fork 729
Open
Description
🐛 Bug
In order to enable inversion of an STFT via the inverse STFT in istft, it is sufficient that the signal windowing obeys the constraint of “Constant OverLap Add” (COLA). This ensures that every point in the input data is equally weighted, thereby avoiding aliasing and allowing full reconstruction.
https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.check_COLA.html
Learn more: https://ccrma.stanford.edu/~jos/sasp/Mathematical_Definition_STFT.html#19930
To Reproduce
>>> from scipy import signal
>>> import torch
>>> signal.check_COLA(signal.hann(1024, sym=False), 1024, 1024 - 256)
True
>>> signal.check_COLA(torch.hann_window(1024).numpy(), 1024, 1024 - 256)
False
>>> window = torch.hann_window(1024).numpy()
>>> window[0] *= 0.5
>>> window[-1] *= 0.5
>>> signal.check_COLA(window, 1024, 1024 - 256)
False
Expected behavior
The expected behavior is that the hann window is implemented such that it is useable with istft
.
Metadata
Metadata
Assignees
Labels
No labels