stft_cola_check — ACOUSTICS transform op

資料種類:table(僅由參數決定的運算子 —— 不接受影像或資料輸入)

呼叫:import acoustics; acoustics.stft_cola_check(window='hann', win=256, hop=None)(或 opsacoustics.get("stft_cola_check"))

用法

這組(窗, 跳距)是否滿足 COLA,以及滿足得有多精確。

> 以下的詳細說明為原文 —— 摘要與標題已翻譯。

COLA — the analysis windows summing to a constant over the hop lattice — is

what lets plain overlap-add work without a division. It is *not* required by

:func:istft, which is weighted, but it is required by anything that

overlap-adds modified frames without renormalising, and getting it wrong

produces a periodic amplitude ripple at `rate/hop` Hz that looks like

tremolo rather than like a bug.

Returns a dict: `cola (bool), constant` (the mean of the overlap sum),

`max_deviation (absolute), relative_deviation, nola` (bool),

`min_squared_sum`, plus the geometry.

Measured (periodic windows, `relative_deviation` of the plain sum):

======== ==== ==== ================== ======== ====

window win hop relative_deviation constant COLA

======== ==== ==== ================== ======== ====

hann 256 128 4.44e-16 1.00 yes

hann 256 64 2.22e-16 2.00 yes

hann 256 85 1.48e-03 1.506 no

hamming 256 128 2.06e-16 1.08 yes

blackman 256 128 1.91e-01 0.84 no

blackman 256 64 3.97e-16 1.68 yes

boxcar 256 128 0.00e+00 2.00 yes

======== ==== ==== ================== ======== ====

The two blackman rows are the useful ones: the same window is COLA at

hop = win/4 and 19 % off at hop = win/2, so "which window" is not the

question — the pair is. The boxcar row was worth measuring rather than

assuming: a rectangular window at 50 % overlap sums to exactly 2 and is

COLA, which is the opposite of the usual intuition about it. Note also that

the constant is not 1 in general — an overlap-add that does not divide by it

is off by a *gain*, which is the failure that looks like a working system.

Raises `ValueError: unknown / all-zero window, hop` outside

`[1, win], win outside [2, MAX_WINDOW]`.

詳細使用指南

acoustic_condition_monitoring 族使用指南

參考(範例資料・文獻)

• 範例資料目錄(下載 URL / 授權) —— 2-D 用 skimage.data(BSD/公有領域)加合成圖,3-D 給出真實資料源(Stanford/PDS 等)的下載 URL。

• 運算子來歷與參考文獻 —— 該運算子族所依據的研究/方法出處。

• 演算法的正典(作者・年份)與用途見上面的族使用指南

可執行的範例(實際呼叫該運算子並已驗證的樣例)

acoustic_condition_monitoringpy -3.11 examples/acoustic_condition_monitoring.py

型別可銜接的下一個運算子(可接受 table 作為輸入)

istft

同類別(transform)

stft · istft


*Provenance: acoustics.py — ACOUSTICS 運算子登記表。本條目由 tools/opdocs.py md 自動產生(請勿手動編輯)。*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.