scipy 1.8.0 Pypi GitHub Homepage
Other Docs
NotesParametersReturnsBackRef
check_NOLA(window, nperseg, noverlap, tol=1e-10)

Notes

In order to enable inversion of an STFT via the inverse STFT in istft , the signal windowing must obey the constraint of "nonzero overlap add" (NOLA):

$$\sum_{t}w^{2}[n-tH] \ne 0$$

for all $n$ , where $w$ is the window function, $t$ is the frame index, and $H$ is the hop size ( $H$ = :None:None:`nperseg` - :None:None:`noverlap`).

This ensures that the normalization factors in the denominator of the overlap-add inversion equation are not zero. Only very pathological windows will fail the NOLA constraint.

versionadded

Parameters

window : str or tuple or array_like

Desired window to use. If :None:None:`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 :None:None:`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

verdict : bool

:None:None:`True` if chosen combination satisfies the NOLA constraint within :None:None:`tol`, :None:None:`False` otherwise

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

See Also

check_COLA

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

istft

Inverse Short Time Fourier Transform

stft

Short Time Fourier Transform

Examples

>>> from scipy import signal

Confirm NOLA condition for rectangular window of 75% (3/4) overlap:

>>> signal.check_NOLA(signal.windows.boxcar(100), 100, 75)
True

NOLA is also true for 25% (1/4) overlap:

>>> signal.check_NOLA(signal.windows.boxcar(100), 100, 25)
True

"Symmetrical" Hann window (for filter design) is also NOLA:

>>> signal.check_NOLA(signal.windows.hann(120, sym=True), 120, 60)
True

As long as there is overlap, it takes quite a pathological window to fail NOLA:

>>> w = np.ones(64, dtype="float")
... w[::2] = 0
... signal.check_NOLA(w, 64, 32) False

If there is not enough overlap, a window with zeros at the ends will not work:

>>> signal.check_NOLA(signal.windows.hann(64), 64, 0)
False
>>> signal.check_NOLA(signal.windows.hann(64), 64, 1)
False
>>> signal.check_NOLA(signal.windows.hann(64), 64, 2)
True
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

scipy.signal._spectral_py.check_NOLA scipy.signal._spectral_py.stft scipy.signal._spectral_py.check_COLA scipy.signal._spectral_py.istft

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/signal/_spectral_py.py#899
type: <class 'function'>
Commit: