Home / Docs-Technical WhitePaper / 08-EFT.WP.Core.Sea v1.0
Appendix C — Filter and Window Function Library
I. Purpose and Scope
- Purpose
Assemble the window functions and digital filter prototypes used throughout this volume, with unified symbols, scaling, and acceptance criteria. The entries connect directly to I80-3 (conditioning & filtering) and I80-4 (spectra & features). - Where it applies
Sampling & anti-aliasing (see Chapter 4), PSD and feature extraction (see Chapter 5), and group-delay alignment for arrival-time estimation (see Chapter 8). - Unified abbreviations
fs (sample rate), N (FFT length or FIR tap count), w[n] (window), H(f) (transfer function), tau_g(H) (group delay), A_s_db (stopband attenuation in dB), A_p_db (passband ripple in dB).
II. Window Common Metrics and Scaling
- Coherent gain and amplitude correction
CG = ( ∑_{n=0}^{N-1} w[n] ) / N
C_amp = 1 / CG (amplitude correction factor) - Equivalent noise bandwidth (in FFT-bin and Hz units)
ENBW_bins = N * ( ∑ w[n]^2 ) / ( ∑ w[n] )^2
ENBW_Hz = ( fs / N ) * ENBW_bins - Main-lobe width (zero-to-zero approximation)
Delta_f_main approx K_main * ( fs / N ), with K_main window-dependent. - Ripple and scalloping loss
First sidelobe suppression A_s_db; scalloping loss SL_db (max amplitude loss when a tone lies mid-bin). - PSD calibration (one-sided)
S_xx(f) = ( 2 / ( fs * U_w ) ) * |X_w(f)|^2, where U_w = (1/N) * ∑ w[n]^2 and X_w is the DFT of windowed data.
III. Window Catalog (Property Library v1.0)
- Rectangular
K_main = 2.00; A_s_db approx 13; ENBW_bins = 1.00; SL_db approx 3.92.
Use for: line amplitude fidelity when leakage is tolerable. - Hann (raised cosine)
K_main = 4.00; A_s_db approx 31.5; ENBW_bins approx 1.50; SL_db approx 1.42.
Use for: general spectra with lower leakage. - Hamming
K_main = 4.00; A_s_db approx 41; ENBW_bins approx 1.36; SL_db approx 1.78.
Use for: tighter sidelobe needs; leakage/resolution trade-off. - Blackman (3-term)
K_main = 6.00; A_s_db approx 58; ENBW_bins approx 1.73; SL_db approx 1.1.
Use for: high sidelobe suppression at moderate resolution. - Blackman–Harris (4-term)
K_main = 8.00; A_s_db approx 92; ENBW_bins approx 2.00; SL_db approx 0.9.
Use for: tone detection near the noise floor. - Nuttall (4-term)
K_main = 8.00; A_s_db approx 93; ENBW_bins approx 2.02; SL_db approx 0.9.
Use for: BH-like very low sidelobes. - Flat-top (5-term)
K_main approx 10.0; A_s_db approx 93; ENBW_bins approx 3.77; SL_db approx 0.01.
Use for: amplitude-accurate PSD when frequency resolution is secondary. - Kaiser (parameter beta)
Relation between A_s_db and beta (design convention):
• beta = 0 → Rectangular
• beta approx 0.1102 * ( A_s_db - 8.7 ) (for A_s_db > 50)
• beta approx 0.5842 * ( A_s_db - 21 )^{0.4} + 0.07886 * ( A_s_db - 21 ) (for 21 <= A_s_db <= 50)
K_main and ENBW_bins increase with beta.
Use for: FIR design meeting specified A_s_db and transition bandwidth. - Dolph–Chebyshev (parameter A_s_db)
Equal-ripple sidelobes with minimum main-lobe width for a given A_s_db.
Use for: extreme sidelobe control with tight main-lobe.
IV. FIR Filter Library and Design Recipes
- Unified spec & naming
FIR.lp.<window|remez>.<N>.<f_p>.<f_s>; likewise FIR.hp.*, FIR.bp.*, FIR.bs.*. Frequencies recorded as f_hat = f / fs. - Kaiser window method (low-pass example)
- Specs: f_p, f_s, A_s_db, A_p_db. Let Delta_ω = 2 * pi * ( f_s - f_p ).
- Order estimate: N_min approx ceil( ( A_s_db - 8 ) / ( 2.285 * Delta_ω ) ) + 1.
- Coefficients: h[n] = sinc( 2 * f_c * ( n - (N-1)/2 ) ) * kaiser(n, N, beta), with f_c = ( f_p + f_s ) / 2.
- Linear-phase group delay: tau_g(H) = ( N - 1 ) / ( 2 * fs ).
- Remez (Parks–McClellan) equiripple FIR
Pass/stop weights W_p, W_s → achieves equal ripple A_p_db, A_s_db.
Use for: compact order when the transition band is most constrained. - Multi-band bandpass and notch
Construct via spectral algebra: FIR.bp = LP(f_hi) - LP(f_lo); notch FIR.bs = 1 - FIR.bp, then normalize and level-match. - Acceptance
max_pass_ripple <= A_p_db; min_stop_atten >= A_s_db; alias bound E_alias per Chapter 4 Mx-C2.
V. IIR Prototypes and Biquad Realization
- Naming & implementation
IIR.bw.lp.<n>.<f_c> (Butterworth), IIR.ch1.lp.<n>.<f_p,A_p_db> (Chebyshev I), IIR.ch2.lp.<n>.<f_s,A_s_db> (Chebyshev II), IIR.ell.lp.<n>.<f_p,f_s,A_p_db,A_s_db> (Elliptic).
Digitize via bilinear transform; pre-warp Omega = tan( pi * f_hat ). - Order estimate (example: Butterworth LP)
n_min = ceil( log10( (10^{0.1*A_s_db} - 1) / (10^{0.1*A_p_db} - 1) ) / ( 2 * log10( Omega_s / Omega_p ) ) ). - Biquad (RBJ form; LP)
omega0 = 2 * pi * f_c / fs, alpha = sin(omega0) / ( 2 * Q ).
b0 = (1 - cos(omega0)) / 2, b1 = 1 - cos(omega0), b2 = (1 - cos(omega0)) / 2;
a0 = 1 + alpha, a1 = -2 * cos(omega0), a2 = 1 - alpha;
normalize: b* /= a0, a1 /= a0, a2 /= a0. - Second-order notch
omega0 = 2 * pi * f0 / fs, r = exp( - pi * BW / fs ).
H(z) = ( 1 - 2 * cos(omega0) * z^{-1} + z^{-2} ) / ( 1 - 2 * r * cos(omega0) * z^{-1} + r^2 * z^{-2} ). - Group delay
IIR tau_g(H) is frequency-dependent; arrival-time estimation must reference tau_mono and log compensation in trace (see Chapter 8).
VI. Multirate Filtering and CIC Pipelines
- CIC N-stage, R-rate decimator
H_cic(z) = ( ( 1 - z^{-R} ) / ( 1 - z^{-1} ) )^N.
Passband droop: |H_cic(f)| approx | sin(pi * f * R / fs) / ( R * sin(pi * f / fs) ) |^N.
Typical chain: [CIC] -> [FIR.compensation] -> [IIR.smoothing]. - Guidance
Prefer CIC for large decimation; add a short FIR to flatten the passband and achieve A_s_db.
VII. Group Delay, Phase, and Impact on Arrival Time
- FIR linear-phase compensation
tau_align = ( N - 1 ) / ( 2 * fs ); subtract from ts or shift the waveform by an integer number of samples. - IIR phase nonlinearity
Measure tau_g(H) offline; apply band-limited average compensation to the time base used by estimate_toa; preserve evidence via trace.
VIII. Leakage, Aliasing, and Spectral Accuracy Notes
- Anti-aliasing (see Chapter 4)
Prioritize analog H(f); digital filt.chain follows. Windows reduce leakage but cannot stop super-Nyquist aliases. - Three-metric window pick for line spectra
Choose by A_s_db, ENBW_bins, SL_db. Flat-top for amplitude metrology; Blackman–Harris/Nuttall for detection; Hann/Hamming for localization. - Frequency and amplitude uncertainty
Resolution Delta_f = fs / N; main-lobe bound Delta_f_main.
Amplitude uncertainty U_amp approx f( SL_db, SNR, ENBW_bins ), reported as part of U = k * u_c.
IX. Selection Guidance (By Scenario)
- Laboratory amplitude metrology
Window: Flat-top; Filter: FIR.lp denoise then peak-pick; report ENBW_bins and C_amp. - Field weak-signal detection
Window: Blackman–Harris or Nuttall; Filter: FIR.bp on target band; add IIR.notch for mains if needed. - Streaming online monitoring
Window: Hann; Filtering: CIC + FIR.comp during decimation; keep rho < 1 for real-time stability (see Core.Threads).
X. I80 Bindings and Usage Snippets
- Design & apply
fref = design_filter(kind="fir_lp", params={"f_p":0.18,"f_s":0.22,"A_s_db":80,"method":"kaiser"})
sig_f = filter_apply(sig=block, filt=fref)
S = psd(sig=sig_f, method="welch", seg=8, overlap=0.5, window="hann")
- Resampling & anti-aliasing
sig_ds = resample(sig=sig_f, fs_target=fs/4, mode="polyphase") # filt.chain includes anti-alias LP
XI. Acceptance and Recording Template
- Required fields
filt.kind, filt.N, filt.params, filt.A_p_db, filt.A_s_db, filt.Delta_f, filt.tau_g, window.name, window.ENBW_bins, window.C_amp. - Quality thresholds
A_s_db >= A_s_min; A_p_db <= A_p_max; Delta_f_main <= Delta_f_budget; |tau_g - tau_align| <= eps_tau.
XII. Versioning and Naming
- Anchors
filt.H_rev, spec.window_rev, chain.rev increment on parameter change. - Freezing rule
Any change of window, N, or A_s_db constitutes a new version; record in io.manifest_rev (see Chapter 7).
XIII. Quick Reference (Typical Window Numbers, agreed convention)
- Rectangular: K_main=2.00, A_s_db=13, ENBW_bins=1.00, SL_db=3.92.
- Hann: K_main=4.00, A_s_db=31.5, ENBW_bins=1.50, SL_db=1.42.
- Hamming: K_main=4.00, A_s_db=41, ENBW_bins=1.36, SL_db=1.78.
- Blackman: K_main=6.00, A_s_db=58, ENBW_bins=1.73, SL_db=1.1.
- Blackman–Harris(4): K_main=8.00, A_s_db=92, ENBW_bins=2.00, SL_db=0.9.
- Flat-top(5): K_main≈10.0, A_s_db=93, ENBW_bins=3.77, SL_db≈0.01.
- Kaiser: beta from A_s_db (above); K_main and ENBW_bins increase with beta.
XIV. Cross-Volume Anchors and Citations
- Anti-aliasing & path: H(f), f_c, BW, tau_g(H) (see Chapter 4).
- Arrival time: T_arr, gamma(ell), n_eff(x,t), c_ref (see Chapter 8 and the Energy Filaments companion).
- Concurrency & stability: chan, cap, bp, W_q, rho < 1 (see EFT.WP.Core.Threads v1.0).
XV. Closing Note
This library fixes the design, calibration, and recording conventions for windows and filters in a uniform symbol system and plain-text formulas, enabling comparability for S_xx(f), time consistency for T_arr, and reproducibility across scenarios.
Copyright & License (CC BY 4.0)
Copyright: Unless otherwise noted, the copyright of “Energy Filament Theory” (text, charts, illustrations, symbols, and formulas) belongs to the author “Guanglin Tu”.
License: This work is licensed under the Creative Commons Attribution 4.0 International (CC BY 4.0). You may copy, redistribute, excerpt, adapt, and share for commercial or non‑commercial purposes with proper attribution.
Suggested attribution: Author: “Guanglin Tu”; Work: “Energy Filament Theory”; Source: energyfilament.org; License: CC BY 4.0.
First published: 2025-11-11|Current version:v5.1
License link:https://creativecommons.org/licenses/by/4.0/