cupyx.scipy.signal.check_COLA#

cupyx.scipy.signal.check_COLA(window, nperseg, noverlap, tol=1e-10)[source]#

Check whether the Constant OverLap Add (COLA) constraint is met.

Parameters:
  • window (str or tuple or array_like) – Desired window to use. If window is a string or tuple, it is passed to get_window to generate the window values, which are DFT-even by default. See get_window for a list of windows and required parameters. If window is array_like it will be used directly as the window and its length must be nperseg.

  • nperseg (int) – Length of each segment.

  • noverlap (int) – Number of points to overlap between segments.

  • tol (float, optional) – The allowed variance of a bin’s weighted sum from the median bin sum.

Returns:

verdictTrue if chosen combination satisfies COLA within tol, False otherwise

Return type:

bool

See also

check_NOLA

Check whether the Nonzero Overlap Add (NOLA) constraint is met

stft

Short Time Fourier Transform

istft

Inverse Short Time Fourier Transform

Notes

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.

Some examples of windows that satisfy COLA:
  • Rectangular window at overlap of 0, 1/2, 2/3, 3/4, …

  • Bartlett window at overlap of 1/2, 3/4, 5/6, …

  • Hann window at 1/2, 2/3, 3/4, …

  • Any Blackman family window at 2/3 overlap

  • Any window with noverlap = nperseg-1

A very comprehensive list of other windows may be found in [2], wherein the COLA condition is satisfied when the “Amplitude Flatness” is unity. See [1] for more information.

References