dual op• Data kinds: signal × signal → measurement
• Call: import fullseye as fs; fs.ledger.gcc_delay(a, b, rate=1.0, weight='phat', band=None, interpolate=True) (to call the implementation directly, import acoustics; acoustics.gcc_delay(a, b, rate=1.0, weight='phat', band=None, interpolate=True); from the registry, opsacoustics.get("gcc_delay"))
• Return value through the ledger: fullseye.ledger.gcc_delay(...) returns **only the declared out type measurement** (the underlying function also returns auxiliary values). When you need what was dropped, use fullseye.ledger.gcc_delay.raw(...) or call acoustics.gcc_delay directly.
> This operator's description has not been translated yet. The original text follows as it is.
2 チャンネルの到達時間差を一般化相互相関(GCC)で測る。→ `(delay, table)`。
漏水の位置決め、音源の方向、超音波の肉厚、振動の伝搬 —— どれも「同じ源が 2 か所に
いつ着いたか」の差で決まる。この op はその差を秒(`rate` が既定 1.0 なら標本)で
返す。位置に直すには経路長と伝搬速度を掛ける(`x = (L - c·delay) / 2` の形)。
★速度の仮定がそのまま位置の誤差になる。相関がどれだけ綺麗でも、掛ける速度が
10 % 違えば位置は経路の中心からの距離に比例してずれる(poc_leak_localization の
実測: 中心から 18 m の漏水で +1.798 m、幾何の予測 1.800 m)。相関の質と位置の
正しさは別の量なので、報告では分けること。
Args:
a, b: 同じ長さの 1-D 記録。**`b が a より遅れていれば delay` は正**
(`b(t) ≈ a(t - delay)`)。
rate: 標本化周波数 [Hz]。既定 1.0 のときは返りの単位が「標本」。
weight: 相互スペクトルの重み。
`"none"` = 素の相互相関(SNR が高く反射が無ければ最良)、
`"phat"` = 位相変換(振幅を白色化。残響に強いとされる)、
`"roth" = 1/|A|²、"scot" = 1/sqrt(|A|²|B|²)`。
★PHAT が常に勝つわけではない: 反射が非対称な経路では遅延そのものが
偏るので、どの重みでも取り除けない(実測: 反射 0.8 で raw 0.134 m /
PHAT 0.114 m と 1 割しか違わず、RMS はほぼ全部が偏り)。
band: `(lo_hz, hi_hz) で帯域を絞る(rate が要る)。None` で全帯域。
全帯域の PHAT は信号の無いビンまで持ち上げるので、**帯域を切るほうが
効くことが多い**(実測で 8 倍)。
interpolate: ピーク周りの放物線補間でサブ標本まで読む(既定 True)。
切ると量子化の刻みが散らばりでなく偏りとして残る(位置を固定すると
毎回同じ方向に外す。PIV のピークロッキングと同じ)。
★補間しても偏りは消えない: 相関のピークは sinc 状で、放物線では
近似しきれない。白色雑音・全帯域で 0〜1 標本を振った実測では、
誤差が 最大 0.117 標本の S 字(整数の近くで 0、0.3 / 0.7 付近で最大、
向きは整数へ引く)。サブ標本の精度を語るときはこの偏りを含めること。
Returns:
`(delay, table): delay は秒(rate=1.0` なら標本)の float。
`table は `{"lags": (2N-1,) の遅れ, "r": 相関値, "peak": ピーク値,
"snr_peak": ピーク / 副次ピークの比}``。
★台帳経由(`fullseye.ledger.gcc_delay)は宣言 out 型の delay` だけを
返す。相関曲線も要るときは `fullseye.ledger.gcc_delay.raw(...)`。
Raises:
ValueError: 長さが違う / 2 未満 / 非有限、`weight が未知、band` が
`(lo, hi) でない・lo >= hi・rate` に対して無効なとき。
限界(honest): (1) 反射・分散・経路差が作る偏りは取れない ——
取れるのは雑音による散らばりだけ。(2) 相関のピークを 1 つ選ぶので、
多重路で副次ピークが勝つと不連続に外す(`snr_peak` を見ること)。
(3) 遅延が記録長の半分を超えると折り返す。
Reference (public): C. H. Knapp, G. C. Carter, "The Generalized Correlation
Method for Estimation of Time Delay", IEEE Trans. ASSP 24(4), 1976, 320-327.
• acoustic_condition_monitoring family guide
• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).
• Operator provenance and references — the sources of the research/methods this op family came from.
• The canonical algorithm (author, year) and its uses are named in the family usage guide above.
• acoustic_condition_monitoring — py -3.11 examples/acoustic_condition_monitoring.py
measurement as input)—
dual)*Provenance: acoustics.py — ACOUSTICS operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.