Features for Signals and Machines
Windows, RMS, crest factor, kurtosis, spectrum bands, bearing frequencies and operating conditions: the features that make condition monitoring work.
Why features
A vibration sensor at 4 kHz delivers 4 000 numbers a second, almost all of them redundant. A model fed raw samples needs enormous amounts of data to find the pattern; a model fed a handful of features (numbers that summarize a short stretch of signal and carry the physics) often works with a few hundred examples and a simple, explainable method. Good features are usually worth more than a better algorithm (see Trees, Clustering and Anomaly Detection), and they let you use what you know about the machine.
| Signal | Typical features | What they reveal |
|---|---|---|
| Vibration | RMS, peak, crest factor, kurtosis, band energies, order amplitudes | Imbalance, misalignment, looseness, bearing and gear faults |
| Motor current | RMS, harmonics, sidebands around the supply frequency, power factor | Broken rotor bars, eccentricity, load changes, jams |
| Sound | Spectrum bands, spectral centroid, MFCCs | Leaks, cavitation, wear, a changed running sound |
| Temperature | Level, rate of rise, difference to ambient or to a neighbor | Friction, blocked cooling, an electrical fault |
| Pressure, flow, torque | Mean, ripple, slope, stroke time | Valve wear, pump faults, leaks |
| Process data | Ratios, energy per unit, deviation from set-point | Yield and quality, efficiency loss |
Windows
Cut the stream into windows and compute features per window. The window must be long enough to hold several cycles of the slowest thing you care about, and short enough that conditions are steady within it. Overlapping windows (50 %) give more rows but nearly duplicate ones; split by stretch of time, not by window (see Data Preparation, Splitting and Leakage).
Worked example: window length and frequency resolution
- The frequency resolution of a window is Δf = fs ÷ N = 1 ÷ T. The recording here has fs = 4 000 Hz and N = 512 samples (128 ms), so Δf = 7.8 Hz.
- To resolve lines 1 Hz apart (for example a 50 Hz line from a 51 Hz line) you need T = 1 ÷ 1 = 1 s, N = 4 000 samples at 4 000 Hz. Sampling faster does not help; only a longer window does (see Sampling, Aliasing and Filtering).
- Sample fast enough for the fault: the bearing impacts below ring at about 900 Hz, so fs must exceed 1 800 Hz, and in practice about 2.5 times the highest frequency of interest (3 840 Hz for 1 500 Hz), behind an anti-alias filter.
Time-domain features
| Feature | Formula | Meaning |
|---|---|---|
| Mean | x̄ = Σ x ÷ N | The offset; remove it first |
| RMS | √(Σ x² ÷ N) | The overall energy: a steady measure of how much it shakes |
| Peak | max |x| | The largest excursion; sensitive to single spikes |
| Crest factor | peak ÷ RMS | Impulsiveness: 1.41 for a sine, higher with impacts |
| Kurtosis | Σ (x − x̄)⁴ ÷ N ÷ σ⁴ | 3 for noise; rises sharply with sparse impacts |
| Skewness | Σ (x − x̄)³ ÷ N ÷ σ³ | Asymmetry: one-sided impacts or clipping |
| Zero-crossing rate | sign changes per second | A crude frequency measure |
Worked example: healthy against a bearing fault
Two 512-sample windows at 4 000 Hz: one from a healthy machine (a 50 Hz shaft line, a 150 Hz harmonic and noise), one with a bearing fault that adds an impact every 1/87 s ringing at about 900 Hz.
| Feature | Pure sine (reference) | Healthy | Bearing fault |
|---|---|---|---|
| RMS | 0.71 | 0.78 | 0.97 |
| Peak | 1.00 | 1.43 | 3.61 |
| Crest factor | 1.41 | 1.84 | 3.72 |
| Kurtosis | 1.50 | 1.53 | 3.17 |
- The RMS rises from 0.78 to 0.97: it changes, but a change in load or speed would move it too.
- The crest factor goes from 1.84 to 3.72 and the kurtosis from 1.53 to 3.17: the impacts show up as a few large samples.
- Caution: in an advanced fault the impacts overlap and become continuous, and the crest factor and kurtosis fall back toward normal even though the machine is worse. Always use several features, and watch the trend (below).
Frequency-domain features
The spectrum (from an FFT of a windowed segment) splits the signal into frequencies, where faults live at predictable places: shaft speed and its harmonics (imbalance, misalignment), gear-mesh frequency (gears), bearing frequencies (below), and high-frequency resonances (impacts). Use band energies: sum the squared amplitudes in chosen frequency bands.
Worked example: energy in a band
- Using a Hann window and the FFT of each 512-sample segment, the energy in the 700 to 1 100 Hz band is 0.008 for the healthy machine and 0.741 for the faulty one, a factor of 93.
- As a fraction of the total (0 to 2 000 Hz), the band holds 0.46 % in the healthy machine and 26.5 % in the faulty one: a ratio is steadier than an absolute value when the overall level changes.
- The 50 Hz shaft line and its 150 Hz harmonic are present in both; they identify rotation, not the fault.
- Always window the data (Hann) before the FFT, or energy leaks across the spectrum; average several spectra to cut the scatter.
- Use fixed bands tied to the machine (multiples of shaft speed), not fixed hertz, if speed varies (order analysis).
- A spectrogram (spectrum against time) is a picture: it can be fed to a convolutional network (see Neural Networks and Deep Learning).
- Wavelets and spectral kurtosis pick the best band automatically for impulsive faults.
Bearing and gear frequencies
A rolling bearing defect produces an impact each time a ball passes it. The repetition rate depends only on the geometry and the shaft speed. With n balls of diameter Bd, pitch diameter Pd, contact angle θ and shaft frequency fr:
BPFO = (n ÷ 2) (1 − Bd/Pd cos θ) fr BPFI = (n ÷ 2) (1 + Bd/Pd cos θ) fr BSF = (Pd ÷ 2Bd) (1 − (Bd/Pd cos θ)²) fr FTF = ½ (1 − Bd/Pd cos θ) fr
Worked example: a 6205-type deep-groove bearing at 1 800 rpm
Take n = 9 balls, Bd = 7.94 mm, Pd = 39.04 mm, θ = 0 and 1 800 rpm, so fr = 30 Hz and Bd ÷ Pd = 0.203.
| Defect | Frequency | As a multiple of shaft speed |
|---|---|---|
| Outer race (BPFO) | 107.5 Hz | 3.58 × |
| Inner race (BPFI) | 162.5 Hz | 5.42 × |
| Ball spin (BSF) | 70.7 Hz | 2.36 × |
| Cage (FTF) | 11.9 Hz | 0.40 × |
Look for energy at these frequencies (and their harmonics) in the envelope spectrum below. The values are non-integer multiples of the shaft speed, which distinguishes bearing faults from imbalance. Use the manufacturer’s exact geometry; these are the textbook values. Gears have a mesh frequency of teeth × shaft frequency, with sidebands at the shaft frequency when a tooth is damaged.
Envelope analysis
The impacts are weak against the machine’s own vibration and ring at a high, unrelated frequency, so the bearing frequency does not appear directly in the ordinary spectrum. Envelope analysis recovers it: band-pass (or high-pass) filter around the ringing, take the envelope (rectify and smooth, or the Hilbert transform), then compute the spectrum of the envelope. The repetition rate of the impacts shows as a line.
Worked example: finding the repetition rate
- High-pass the faulty window to remove the 50 and 150 Hz lines, rectify, smooth over about 4 ms and subtract the mean. The strongest line between 30 and 300 Hz is at 85.9 Hz (amplitude 0.285): the impacts were generated at 87 Hz, within the 7.8 Hz resolution of the window.
- The same processing of the healthy window finds no strong line: its largest peak is 0.016, against 0.285 for the faulty one.
- Compare the line with the bearing frequencies: a line at the BPFO of the bearing (107.5 Hz in the table above) would point to its outer race. (The 87 Hz here is a made-up rate for the demonstration.)
Operating conditions
Normal changes in speed and load move every feature. A feature that rises with load is not a fault. Either include the operating conditions as inputs (load, speed, temperature, product) or compare like with like (only windows at the same load).
Worked example: removing the effect of load
- On healthy runs the RMS vibration is 2.0 at 40 % load and 3.0 at 100 %: a slope of 0.017 per % load.
- Today’s window at 80 % load reads 3.9. The healthy expectation is 2.0 + 0.017 × 40 = 2.67, so the residual is 1.23.
- Judged without the load, 3.9 looks only a little above the healthy range of 2.0 to 3.0. Judged against the expectation for this load, it is clearly high. The residual is the better feature, and is what regression on healthy data gives you (see Regression and Curve Fitting).
- Order tracking expresses frequency as multiples of shaft speed, so fault lines stay in the same place when speed changes.
- Record the conditions with every window (see Planning a Logging System): you cannot add context to data afterwards.
- Cover the range in training: a model that has only seen 80 % load has no idea what 40 % looks like.
Trends and remaining life
A single window says how the machine is now; the trend of a feature over days and weeks says how it is changing, and often matters more. Wear usually accelerates, so a feature that is flat for months and then climbs gives a warning.
Worked example: weeks until the alarm limit
- Weekly RMS vibration: 2.10, 2.12, 2.08, 2.15, 2.22, 2.31, 2.45, 2.62, 2.85, 3.15, 3.50, 3.95 mm/s over 12 weeks. It is flat for about 4 weeks, then rising.
- Fitting a straight line to the last three points gives only a local slope of 0.40 mm/s per week, and would understate the acceleration. Fitting an exponential (a straight line to ln RMS) gives a growth of 5.9 % per week (R² = 0.893), though it fits the early flat period poorly.
- The extrapolated curve reaches an alarm limit of 7.1 mm/s (illustrative: take the real limit from ISO 20816 for your machine class) after about 24.3 weeks, which is 12.3 weeks from now.
- Treat this as a rough estimate with wide error bars. A fitted trend assumes the wear continues the same way; a maintenance action, a change of load or a lubrication problem changes it. Re-fit every week and plan maintenance with margin.
Current, sound, temperature and images
- Motor current signature analysis (MCSA): spectrum of one phase current; broken rotor bars and eccentricity add sidebands at ± slip frequency around the supply line (see Motion Control and Actuators). It needs no extra sensor on a drive that already measures current.
- Sound: a microphone near the machine; features from the spectrum (band energies, spectral centroid) or mel-frequency cepstral coefficients (MFCCs). It works for leaks and cavitation but is sensitive to background noise.
- Temperature: use the rate of rise and the difference to ambient or a neighbor, not the absolute level.
- Images: classic features (edges, areas, color) or a convolutional network on the picture itself (see Neural Networks and Deep Learning and Robotics Tools).
- Sensors and mounting matter: an accelerometer must be rigidly stud-mounted near the bearing; a loose magnet changes the response above a few kilohertz (see Sensors and Field Devices).
A feature pipeline
import numpy as np
from scipy.signal import welch, hilbert, butter, sosfiltfilt
from scipy.stats import kurtosis
def features(x, fs, band=(700, 1100)):
x = x - x.mean()
rms = np.sqrt(np.mean(x ** 2))
f, p = welch(x, fs=fs, nperseg=len(x) // 2, window="hann") # power spectrum
in_band = p[(f >= band[0]) & (f < band[1])].sum() / p.sum() # fraction of energy in the fault band
sos = butter(4, [band[0], band[1]], btype="band", fs=fs, output="sos")
env = np.abs(hilbert(sosfiltfilt(sos, x))) # envelope of the ringing
env = env - env.mean()
fe = np.fft.rfftfreq(len(env), 1 / fs); pe = np.abs(np.fft.rfft(env * np.hanning(len(env))))
sel = (fe > 30) & (fe < 300)
return {"rms": rms, "crest": np.max(np.abs(x)) / rms, "kurt": kurtosis(x, fisher=False),
"band_frac": in_band, "env_peak_hz": fe[sel][np.argmax(pe[sel])], "env_peak_amp": pe[sel].max()}
- Use exactly the same function in training and in service (and on the microcontroller, if the model runs there; see Deployment, Monitoring and Limits).
- Log the raw windows as well as the features, so features can be redesigned later without new data (see Logging Strategies).
- Validate on a different machine before trusting a feature: a feature that separates faults on one machine may be a property of that machine.
Related
- Machine Learning: the overview of this guide.
- Trees, Clustering and Anomaly Detection: models to feed these features to.
- Deployment, Monitoring and Limits: computing features on a microcontroller.
- Data Logging: sampling, filtering and timing the signals properly.
- Numerical Methods: FFT, filters and windows in code.
FAQ
Which features should I start with?
RMS, crest factor, kurtosis and the energy in a few frequency bands tied to the machine (shaft speed, gear mesh, bearing frequencies), plus the operating conditions. Add an envelope spectrum for bearings.
Why does my model fail when the speed changes?
The features move with speed and load. Include the conditions as inputs, compute features per order of shaft speed, or compare residuals from a healthy baseline at the same operating point.
How fast must I sample vibration?
At least twice the highest frequency of interest, and about 2.5 times in practice, with an anti-alias filter. Bearing resonances can be several kilohertz.
Can a neural network learn the features itself?
Yes, given enough labeled data, for example a convolutional network on spectrograms. With small data, hand-made, physically meaningful features and a simple model are safer and easier to explain.
References
- Randall, R. B., Vibration-based Condition Monitoring, Wiley; Harris, T. A. and Kotzalas, M. N., Rolling Bearing Analysis, CRC Press.
- ISO 20816 (mechanical vibration: measurement and evaluation of machine vibration), ISO 13373 (condition monitoring and diagnostics of machines: vibration).
- Smith, W. A. and Randall, R. B., “Rolling element bearing diagnostics using the Case Western Reserve University data”, Mechanical Systems and Signal Processing, 64–65 (2015).
Last reviewed: October 2026. The signals on this page are synthetic and the thresholds illustrative; use the manufacturer’s bearing data and the standards for real limits.
