signal op• 데이터 종류: signal → pairs
• 호출: import fullseye as fs; fs.ledger.spectrum(x, rate=1.0)(구현을 직접 호출하려면 import dsp; dsp.spectrum(x, rate=1.0), 원장에서 가져오려면 ops1d.get("spectrum"))
• 원장 경유의 반환값: fullseye.ledger.spectrum(...) 는 **선언된 out 형 pairs 의 값만** 반환합니다(실제 함수는 보조 정보도 반환). 버려진 쪽이 필요하면 fullseye.ledger.spectrum.raw(...) 를 쓰거나 dsp.spectrum 를 직접 호출하세요.
> 이 연산자의 설명은 아직 번역이 없습니다. 원문을 그대로 싣습니다.
Raw one-sided magnitude spectrum -> `(freqs, magnitude) (np.fft.rfft`).
Scaling convention — read this before comparing any number. *One-sided*
describes the frequency axis, not the amplitude axis. `rfft` keeps only the
non-negative frequencies, so `freqs runs from 0 to rate/2` in
`len(x)//2 + 1 bins — but magnitude` is the unnormalised
`|rfft(x)|. It is *not* an amplitude and it grows with len(x)`: the same
tone recorded twice as long comes back twice as tall. Nothing here divides by
`N`; the caller does, and the exact factor depends on the bin::
freqs, mag = spectrum(x, rate)
amp = mag * (2.0 / len(x)) # one-sided amplitude, bins 1 .. N/2-1
amp[0] /= 2.0 # DC has no mirror twin -> no factor 2
if len(x) % 2 == 0:
amp[-1] /= 2.0 # nor does the Nyquist bin of an even N
The factor is `2/N and not 1/N` because a real sinusoid of amplitude
`A splits its energy over a positive and a negative frequency; rfft`
discards the negative half, so the surviving bin holds `A*N/2`. DC and (for
even `N`) Nyquist are their own mirror image and are *not* doubled —
applying `2/N` to them reports twice the true level.
Measured, so the convention can be checked rather than assumed. A unit sine
at a bin centre (`rate = 25600 Hz, N = 25600`, 3000 Hz, amplitude
exactly 1.0): the returned `mag at 3000 Hz is 12799.999999999998`
(= `N/2), and mag * 2/N is 0.9999999999999999`. A constant signal
of value 1.0 with `N = 1024: mag[0] = 1024.0, so mag[0] * 1/N` is
exactly `1.0 while mag[0] * 2/N would claim 2.0`. Likewise
`cos(pi n) (amplitude 1.0 at Nyquist, N = 1024): mag[-1] = 1024.0`,
`* 1/N = 1.0, * 2/N = 2.0`.
Everything scale-*invariant* — where the peak is, the spectral centroid, the
bandwidth, a ratio between two bins — is unaffected by the convention, which
is why :func:signal_features can build on this directly. Everything
absolute (an amplitude in the signal's own units, a dB level) needs the
division above. :func:acoustics.envelope_spectrum and
:func:acoustics.order_spectrum already return calibrated one-sided
amplitudes (they apply their own `2/N` internally) — do not apply the
factor twice when comparing their output with this one.
• 샘플 데이터 카탈로그(DL URL / 라이선스) —— 2-D 는 skimage.data(BSD/public)+ 합성, 3-D 는 실데이터 소스(Stanford/PDS 등)의 DL URL.
• 연산자의 내력·참고문헌 —— 이 연산자 족의 바탕이 된 연구/기법의 출처.
• 알고리즘의 정전(저자·연도)과 용도는 위의 패밀리 사용 가이드에 적혀 있습니다.
• acoustic_condition_monitoring — py -3.11 examples/acoustic_condition_monitoring.py
• poc_bearing_diagnosis — py -3.11 examples/poc_bearing_diagnosis.py
• poc_gear_tooth_metrology — py -3.11 examples/poc_gear_tooth_metrology.py
• poc_machine_condition_fusion — py -3.11 examples/poc_machine_condition_fusion.py
• poc_pipe_wall_loss — py -3.11 examples/poc_pipe_wall_loss.py
• poc_recycling_sorting — py -3.11 examples/poc_recycling_sorting.py
• poc_web_roll_periodicity — py -3.11 examples/poc_web_roll_periodicity.py
pairs 를 입력으로 받는 것)—
signal)lowpass · highpass · bandpass · envelope · rms · local_std · quantize · companding_mu_law
*Provenance: dsp.py — ONED 연산자 레지스트리. 이 op 노트는 tools/opdocs.py md 가 자동 생성합니다(직접 편집하지 마세요).*
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.