coherence — ACOUSTICS dual op

데이터 종류: signal × signaltable

호출: import acoustics; acoustics.coherence(x, y, rate, win=None, hop=None, window='hann')(또는 opsacoustics.get("coherence"))

사용법

보통 결맞음: `yx` 로 선형 설명되는 비율.

> 아래 상세 설명은 원문입니다 —— 요약과 제목은 번역되어 있습니다.

`gamma**2(f) = |Pxy|**2 / (Pxx * Pyy)`, Welch-averaged. It is bounded in

`[0, 1]`, and it is the number that says whether a transfer function is

worth reading at a given frequency.

A single frame makes it identically 1.0 — the Cauchy-Schwarz inequality

is an equality without averaging — so an unaveraged coherence is a perfect

score that carries no information at all. That case is refused, not returned.

`win` defaults to the largest power of two leaving at least 8 frames,

capped at 1024; the value used is returned.

Returns a dict: `freqs, coherence, n_frames, win, hop`,

`rate, mean_coherence, bias` (the coherence a *pair of independent

noise records* would show with this many frames, `1/n_frames` — anything

at or below this is indistinguishable from nothing).

Measured at 16 kHz over 16384 samples, win = 1024, 31 frames:

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

case mean coherence min

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

y = 2.5 * x (noiseless) 1.000000 1.0000

y = 0.8 * x delayed 37 samples 0.983003 0.9661

y = 2.5 x + independent noise, 0 dB SNR 0.509143 0.2219

y, x independent noise 0.035640 0.0001

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

Row three against its closed form: for output noise the expected coherence

is `SNR/(1+SNR)` = 0.5000 at 0 dB, measured 0.5091. Row four against the

bias floor `1/n_frames = 1/31 = 0.0323`, measured 0.0356 — which is why

`bias` is returned: an uncorrelated pair does not read zero, and

reading 0.03 as "a little bit of coupling" is the mistake this number

prevents. Row two shows the other honest limit: a pure delay is a perfectly

linear system and still reads 0.983, not 1, because a delay of 37 samples

moves signal across the frame boundaries the estimator averages over.

Raises `ValueError: everything :func:_as_signal` refuses on either

channel, unequal channel lengths, fewer than 2 frames, `win` longer than

the record, an unknown window.

자세한 사용 가이드

acoustic_condition_monitoring 패밀리 가이드

참고(샘플 데이터·문헌)

• 샘플 데이터 카탈로그(DL URL / 라이선스) —— 2-D 는 skimage.data(BSD/public)+ 합성, 3-D 는 실데이터 소스(Stanford/PDS 등)의 DL URL.

• 연산자의 내력·참고문헌 —— 이 연산자 족의 바탕이 된 연구/기법의 출처.

• 알고리즘의 정전(저자·연도)과 용도는 위의 패밀리 사용 가이드에 적혀 있습니다.

실행 가능한 예제(이 연산자를 실제로 호출하는 검증된 샘플)

acoustic_condition_monitoringpy -3.11 examples/acoustic_condition_monitoring.py

타입이 이어지는 다음 연산자(table 를 입력으로 받는 것)

istft

같은 카테고리(dual)

transfer_function


*Provenance: acoustics.py — ACOUSTICS 연산자 레지스트리. 이 op 노트는 tools/opdocs.py md 가 자동 생성합니다(직접 편집하지 마세요).*

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