| name | signal-processing |
| description | Engineering signal processing — FFT, windowing, aliasing, filtering (FIR/IIR), PSD, coherence, cross-correlation, order tracking, envelope analysis, digital signal conditioning. |
| metadata | {"priority":7,"promptSignals":{"phrases":["signal processing","FFT","sampling","aliasing","filter","PSD","Nyquist","windowing","order tracking","spectrum"],"minScore":3}} |
Engineering Signal Processing — Complete Skill
Sampling and Nyquist
Nyquist-Shannon Theorem
Sample rate f_s must satisfy: f_s > 2 × f_max (signal bandwidth)
Minimum sample rate: f_s = 2 × f_max (Nyquist rate)
Practical: use f_s ≥ 2.5× f_max (accounting for anti-alias filter rolloff)
Anti-alias filter: low-pass at f_s/2 — MUST be analog, before ADC
Aliasing
If f_signal > f_s/2: signal "folds" and appears at f_alias = |f_signal - n×f_s|
Example: f_s = 1000 Hz, f_signal = 800 Hz → f_alias = |800 - 1000| = 200 Hz (wrong peak location)
Prevention: low-pass filter before ADC at f_s/2 (Nyquist frequency)
Resolution and Record Length
Frequency resolution: Δf = f_s / N = 1/T (T = record length [s])
N = number of samples in FFT block
For Δf = 0.5 Hz at f_s = 5000 Hz: N = 5000/0.5 = 10,000 samples (T = 2 sec)
Zoom FFT: narrow frequency range at fine resolution (ZOOM FFT or complex demodulation)
FFT and Spectral Analysis
Discrete Fourier Transform (DFT)
X[k] = Σ_{n=0}^{N-1} x[n] × e^(-j2πkn/N), k = 0, 1, ..., N-1
FFT: fast algorithm, O(N log N) vs. O(N²) for DFT
N must be power of 2 for radix-2 FFT (512, 1024, 2048, 4096...)
Amplitude scaling: FFT amplitude scaled to match engineering units
One-sided spectrum: A[k] = |X[k]| × 2/N for k > 0, × 1/N for k = 0
Phase: φ[k] = angle(X[k]) [rad]
Power Spectral Density (PSD)
G(f) = |X(f)|² / (T × Δf) [units: (unit)²/Hz]
E.g., acceleration: [g²/Hz] or [(m/s²)²/Hz]
From FFT:
S[k] = |X[k]|²/(N × f_s) [two-sided PSD, scaled]
G[k] = 2 × S[k] [one-sided PSD, k > 0]
RMS from PSD:
a_rms = √(∫G(f)df) = √(Σ G[k] × Δf)
Averaging:
N_avg linear averages: PSD variance reduced by 1/N_avg
Random: 50-100 averages needed for stable PSD estimate (±10% variance)
Windowing (Spectral Leakage Control)
Leakage Problem
FFT assumes signal is periodic within record length T
If f_signal ≠ exact multiple of Δf: energy "leaks" to adjacent bins
Effect: broadened peaks, reduced amplitude accuracy
Common Windows
| Window | Main lobe width | Side lobe level | Use |
|---|
| Rectangular | 2/N | -13 dB | Impact (transient fits in window) |
| Hanning | 4/N | -31 dB | Continuous random, harmonic |
| Hamming | 4/N | -41 dB | Narrowband signals |
| Flat-top | 8/N | -93 dB | Accurate amplitude calibration |
| Blackman-Harris | 8/N | -92 dB | Better sidelobe (weaker resolution) |
Rule: use Hanning for continuous signals (vibration, operational modal)
Use Rectangular (no window) + Force/Exponential windows for impact testing
Force window: rectangular but zeroed after impact ends (avoids leakage from force signal)
Exponential window: decays to zero at end of record (applies to response signal in impact test)
Filtering
FIR (Finite Impulse Response) Filter
y[n] = Σ_{k=0}^{M} b_k × x[n-k]
Linear phase (no phase distortion) — preferred for measurement
Design: windowed sinc, remez algorithm, Parks-McClellan
Downside: high order M needed for sharp rolloff (computationally expensive)
IIR (Infinite Impulse Response) Filter
y[n] = Σ b_k x[n-k] - Σ a_k y[n-k]
Non-linear phase (introduces distortion at cutoff region)
Lower order for same rolloff vs. FIR → faster, but phase distortion
Design: Butterworth, Chebyshev, Elliptic
Butterworth: maximally flat passband; -3 dB at cutoff, 20N dB/decade rolloff (N = order)
Chebyshev I: ripple in passband, sharper rolloff
Elliptic: ripple in both pass and stop bands; sharpest rolloff for given order
Zero-phase filtering (MATLAB filtfilt): apply filter forward + backward → zero phase lag
Use for post-processing recorded data (not real-time)
High-pass, Low-pass, Band-pass, Band-stop
HP: remove DC and drift (accelerometers: cutoff 1-5 Hz)
LP: anti-alias, noise reduction
BP: isolate frequency band of interest (engine order)
BS (notch): remove single frequency (60 Hz mains noise)
Cross-Correlation and Coherence
Cross-Correlation
R_xy(τ) = ∫x(t) y(t+τ) dt [time domain; measures lag τ between signals]
Cross-power spectrum: S_xy(f) = FFT{R_xy(τ)}
Used for: time delay measurement (acoustic localization, flow velocity), causality
Coherence Function
γ²(f) = |S_xy(f)|² / (S_xx(f) × S_yy(f)) ∈ [0, 1]
γ² = 1: perfect linear causal relationship
γ² < 0.9 at resonance: noise, nonlinearity, or multiple inputs
Plot coherence alongside FRF to identify valid frequency regions
Order Tracking (Rotating Machinery)
Fixed Sample Rate → Angle-Domain
Standard FFT: fixed time sampling → peaks at frequency [Hz]
Order tracking: resample to fixed angle steps → peaks at order × RPM
Order n: frequency = n × RPM/60 [Hz]; 1st order = RPM/60
Computed order tracking (COT):
Measure tachometer pulse → compute instantaneous speed ω(t)
Resample time-domain signal to equal-angle increments (interpolation)
FFT of angle-domain signal → order spectrum
Phase-locked order tracking (hardware): dedicated hardware synchronizes sampling to shaft rotation
Application: gearbox diagnostics (mesh frequency = N_teeth × RPM/60), bearing fault (non-integer orders)
Envelope Analysis (Bearing Fault Detection)
Procedure
- Band-pass filter around resonance frequency excited by bearing impacts (typically 5-30 kHz)
- Rectify (absolute value)
- Low-pass filter (envelope extraction)
- FFT of envelope → bearing fault frequencies
Bearing fault frequencies (from geometry):
BPFO (outer race): f_BPFO = N/2 × RPM/60 × (1 - d/D cos α)
BPFI (inner race): f_BPFI = N/2 × RPM/60 × (1 + d/D cos α)
FTF (cage): f_FTF = RPM/120 × (1 - d/D cos α)
BSF (ball spin): f_BSF = D/(2d) × RPM/60 × (1 - (d/D)² cos²α)
N = number of balls, d = ball diameter, D = pitch diameter, α = contact angle
Time-Frequency Analysis
Short-Time Fourier Transform (STFT)
Move window through signal, compute FFT at each position
Resolution tradeoff: short window → good time res, poor freq res; long window → good freq res, poor time res
Output: spectrogram (time vs. frequency, color = amplitude)
Wavelet Transform
Variable window: short for high-freq (good time res), long for low-freq (good freq res)
Morlet wavelet: Gaussian-windowed cosine (continuous WT for analysis)
Scalogram: equivalent to spectrogram for wavelets
Hilbert Transform
HT{x(t)} → analytic signal z(t) = x(t) + i×HT{x(t)} = A(t)e^{iφ(t)}
A(t) = instantaneous amplitude (envelope)
dφ/dt = instantaneous frequency
Used for: EMD (empirical mode decomposition), amplitude/phase demodulation
Key Engineering Applications
| Application | Method | Output |
|---|
| Vibration diagnosis | FFT, order tracking | Fault frequency peaks |
| Bearing fault | Envelope analysis | BPFO, BPFI peaks |
| Modal testing | FRF = S_xF/S_FF | H(ω), coherence |
| Structural health | PSD change over time | Frequency shift, damping change |
| Engine knock | STFT | Time of knock event |
| Noise path analysis | Coherence | Source ranking |
Output
Provide: sampling rate f_s [Hz], FFT block size N, frequency resolution Δf [Hz], window type, number of averages, filter type + cutoff, PSD estimate G(f) [unit²/Hz], RMS level, coherence at frequencies of interest.