Decomposing signals into their frequency components using the FFT and extracting quantitative models from data using least-squares regression.
Any periodic signal can be expressed as a sum of sinusoids at the fundamental frequency and its harmonics. The Fourier series provides the theoretical foundation; the Discrete Fourier Transform (DFT) extends this to sampled, finite-length signals.
Frequency resolution: Δf = f_s / N (Hz per bin)
where N = number of samples, f_s = sampling rate
Record length: T = N / f_s (seconds)
Useful frequency range: 0 to f_s/2 (Nyquist limit)
Amplitude scaling: divide magnitude by N/2 for single-sided spectrum
The Fast Fourier Transform (FFT, Cooley-Tukey algorithm) computes the DFT in O(N log N) operations instead of O(N²), making it practical for real-time use. FFT works most efficiently when N is a power of 2.
The DFT assumes the signal is periodic within the record. If the signal does not complete an exact integer number of cycles, the abrupt truncation at the record boundaries introduces artificial frequency components called spectral leakage. A windowing function tapers the signal to zero at the record edges, reducing leakage at the cost of slightly reduced frequency resolution.
No tapering. Best frequency resolution but worst leakage. Acceptable only when signal frequency aligns exactly with an FFT bin.
Good leakage reduction, moderate resolution reduction. Most common choice for general-purpose spectral analysis of continuous signals.
Similar to Hanning but with slightly different coefficients. Better for some transient signals. Widely used in audio and vibration analysis.
Best amplitude accuracy. Used when precise amplitude measurement is critical (calibration). Poor frequency resolution.
Given data pairs (xi, yi), find the best-fit line y = a0 + a1x that minimizes the sum of squared residuals.
a_1 = [N∑(x_i y_i) - ∑x_i ∑y_i] / [N∑(x_i²) - (∑x_i)²]
a_0 = (1/N)(∑y_i - a_1 ∑x_i)
R² = 1 - SS_res / SS_tot
SS_res = ∑(y_i - ŷ_i)² SS_tot = ∑(y_i - ȳ)²
RMSE = √(SS_res / (N-2))
R² = 1.0 means perfect fit. R² = 0.99 means 99% of variance in y is explained by the model. For sensor calibration curves, R² > 0.9999 is typically expected.
Δf = f_s / N = 8192 / 1024 = 8 Hz per bin
f_max = f_s / 2 = 8192 / 2 = 4096 Hz (Nyquist)
Frequency resolution = 8 Hz; Maximum frequency = 4096 Hz
Frequency resolution = 1000/100 = 10 Hz. The FFT bins are at 0, 10, 20, ..., 70, 80, ... Hz. The 75 Hz signal falls exactly between the 70 Hz and 80 Hz bins. Since no bin aligns with 75 Hz, the record does not contain an integer number of cycles (75 Hz × 0.1 s = 7.5 cycles). Yes, significant leakage will occur. Apply a Hanning window to reduce it.
Yes, leakage will occur. 75 Hz falls between bins. Apply Hanning window.