wave_dominant_frequency — MATH wave op

• Data kinds: image2d → table

• Call: import fullseye as fs; fs.ledger.wave_dominant_frequency(image, window='hann') (to call the implementation directly, import mathops; mathops.wave_dominant_frequency(image, window='hann'); from the registry, opsmath.get("wave_dominant_frequency"))

• GPU: none (CPU reference implementation only)

Usage

Return the frequency, period and orientation of the strongest periodicity of an image (the largest non-DC 2-D FFT peak) (table).

> The detailed description below is the original text — the summary and the headings are translated.

平均を引き、window="hann"(既定)なら 2-D の Hann 窓を掛けてから fft2 のパワーの最大(DC は除く)を探し、山の 3 点に対数の放物線を行・列それぞれで当ててビンより細かく読む(wave_fringe_period の 2-D 版。あちらは 1 軸の周期だけ)。window="none" は窓を掛けない(周期が画像幅にちょうど整数個入るときだけ厳密)。

返す dict: fx / fy(列方向・行方向の空間周波数 [cycles/px]、山は fx >= 0 の半平面に揃える)、freq_cpp(hypot(fx, fy))、period_px(1 / freq_cpp)、angle_deg(波数ベクトルの向き = 縞に垂直な向き。+列から +行へ回る角で [0, 180)。縞 cos(2π(x cosθ + y sinθ)/p) なら θ)、peak_fraction(山のビンとその鏡像が DC 以外の全パワーに占める割合 = 周期の確からしさ)、window。

★前提: 照明むらのような低周波は山を奪う(画像より長い周期は DC の隣に出る)。むらがある画像は先に背景を引くか高域通過を掛けること。

空の入力(image が 0 要素)は ValueError。拒否(ValueError): 2-D でない、どちらかの辺が 8 画素未満、非有限の値、平らな画像(周期が無い)、未知の window。

Family-wide input contract (fail-closed)

Every mathops op validates its input before computing (nothing slips through silently):

• complex input raises ValueError — coercing to float64 silently discards the imaginary part (numpy only emits a ComplexWarning and returns a plausible-looking wrong real number). State .real/.imag/abs() explicitly, or use complexops, which handles complex data.

• masked arrays with masked elements raise ValueError — the implicit conversion that peels off the mask and uses the raw values underneath is refused. Say explicitly whether to fill or to drop.

• NaN/Inf raises ValueError on every input (refused with the count stated — it propagates through the whole result).

• Shapes are strict: 1-D and 2-D are never implicitly promoted or broadcast (a matrix in a vector slot, or a vector in a matrix slot, raises ValueError; reshape explicitly).

• Size cap: ops that take a matrix, and the stat_histogram bins, raise ValueError beyond mathops.MAX_ELEMENTS (2^26 ≈ 67 million elements).

Detailed usage guide

• math_metrology family guide

References (sample data, literature)

• 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.

Runnable examples (verified samples that actually call this op)

• wave_dominant_frequency_grating — py -3.11 examples/wave_dominant_frequency_grating.py

Ops the type connects to (they accept table as input)

dynsys_poincare_section · dwt_inverse · chebyshev_eval_nd

Same category (wave)

wave_membrane_mode · wave_mode_frequencies · wave_nodal_lines · wave_two_slit · wave_fringe_period · wave_grating_orders


*Provenance: mathops.py — MATH 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.