Skip to main content

Vibration Analysis

What is vibration analysis?​

Vibration analysis is the measurement and study of how a machine shakes, to judge its condition and find faults before they cause a breakdown. A sensor records the vibration; software turns it into a time waveform and a frequency spectrum, and each fault, such as imbalance, misalignment or a damaged bearing, leaves its own pattern of peaks.

A simulated motor with an outer-race bearing fault in a dark navy theme: a time waveform with sharp repeated impacts, a velocity spectrum with order markers 1× to 8× and a small BPFO line, and an envelope spectrum with clear peaks at BPFO and its harmonics

A simulated motor with a damaged outer bearing race: the time waveform, the velocity spectrum with shaft-speed markers, and the envelope spectrum where the bearing's defect frequency stands out (sample data). Try the interactive version.

Key takeaways
  • Vibration analysis finds machine faults from the way a machine shakes, often weeks or months before they would stop it.
  • Overall vibration, in mm/s RMS, says how bad things are; ISO 20816 sorts it into zones A to D.
  • The spectrum says what is wrong: each fault shows up at its own multiple of the shaft speed, or at a bearing's defect frequency.
  • Early bearing damage barely moves the overall level. Envelope analysis of the high-frequency band finds it.
  • Trend every measurement point over time; the change matters more than any single reading.

It's used on motors, pumps, fans, compressors, gearboxes, turbines and almost any machine that turns.

Why vibration analysis is used: condition monitoring and predictive maintenance​

Machines can be maintained three ways: run them until they break, service them on a fixed schedule, or watch their condition and act when it changes. Watching them is called condition monitoring, and planning repairs from what it shows is predictive maintenance.

Vibration suits rotating machines because almost every mechanical fault changes the forces inside a machine, and changed forces change the vibration. A worn bearing, a loose foot or a shifted coupling all show up long before the machine is noisy, hot or visibly damaged. NASA's reliability-centred maintenance guide covers vibration monitoring and analysis as one of its main predictive testing techniques.

A vibration programme usually works like this:

  1. Choose the machines that matter, and mark fixed measurement points on each bearing, in the horizontal, vertical and axial directions.
  2. Take a reading at each point on a route every few weeks with a portable data collector, or fit permanent wireless or wired sensors that read continuously.
  3. Trend the overall level at each point, and set alarms on it.
  4. When a level rises or crosses an alarm, look at the spectrum and the time waveform to work out the fault and how serious it is.
  5. Plan the repair, then measure again after it to confirm the fix.

Vibration sensors and units​

Vibration can be measured as displacement (how far the surface moves), velocity (how fast it moves) or acceleration (how fast its velocity changes). For a single frequency ff, they are linked by factors of 2πf2\pi f:

v=a2πf,d=v2πfv = \frac{a}{2\pi f}, \qquad d = \frac{v}{2\pi f}

So the same vibration looks large in displacement at low frequencies and large in acceleration at high frequencies. Each sensor suits a band of frequencies and a kind of fault.

SensorMeasuresUsual unitsBest for
Accelerometer (piezoelectric or MEMS), on the bearing housingAccelerationg (1 g = 9.81 m/s²)General use, from a few hertz to over 10 kHz; bearing and gear faults, which show at high frequencies
Velocity sensor, or an accelerometer whose signal is integratedVelocitymm/s (in/s in the USA)Overall machine condition from about 10 Hz to 1 kHz; the quantity severity standards use
Proximity probe (eddy-current), mounted through the bearingShaft displacement relative to the bearingµm (or mils) peak-to-peakShafts in fluid-film (sleeve) bearings on turbines and large compressors; low frequencies and shaft orbits

Most portable data collectors and wireless sensors use an accelerometer, and compute velocity from it.

Peak, peak-to-peak and RMS​

A vibration amplitude can be given three ways. For a pure sine wave:

  • Peak is the largest value from zero.
  • Peak-to-peak is twice the peak: the full swing. It's the usual way to give displacement.
  • RMS (root mean square) is the peak divided by √2, about 0.707 of it. It relates to the energy in the vibration, and it's how ISO severity limits are written.

These ratios only hold for a sine wave. Real vibration with impacts has a much higher peak than RMS, and the ratio of the two, the crest factor, is itself a useful sign of bearing damage.

A worked example: a motor vibrating at 5 mm/s RMS at its running speed of 30 Hz (1,800 rpm) has a peak velocity of 7.1 mm/s, an acceleration of 0.94 m/s² RMS (0.096 g), and a displacement of 26.5 µm RMS, or 75 µm peak-to-peak.

Vibration severity: ISO 20816 zones​

ISO 20816-3 (first published in 2022, replacing ISO 10816-3; revised in 2026) gives vibration limits for industrial machines running at 120 to 30,000 r/min. It measures the overall velocity, in mm/s RMS, on the bearing housings, over 10 to 1,000 Hz for machines above 600 r/min (2 to 1,000 Hz for slower ones), and sorts it into four zones:

  • Zone A: typical of newly commissioned machines.
  • Zone B: acceptable for unrestricted long-term running.
  • Zone C: unsatisfactory for long-term running; plan a repair at the next opportunity.
  • Zone D: severe enough to damage the machine.

The boundaries depend on the size of the machine and how stiff its support is. The values below follow the earlier editions; check them against the 2026 table:

Machine group (ISO 20816-3)SupportA/BB/CC/D
Group 2: medium machines, 15 to 300 kWRigid1.4 mm/s2.8 mm/s4.5 mm/s
Group 2Flexible2.3 mm/s4.5 mm/s7.1 mm/s
Group 1: large machines, 300 kW to 50 MWRigid2.3 mm/s4.5 mm/s7.1 mm/s
Group 1Flexible3.5 mm/s7.1 mm/s11.0 mm/s

The standard also treats a large change as significant on its own, even inside zone B; a change of more than 25% of the B/C boundary is the usual guide. Other parts of the series cover other machines, such as large steam turbines, gas turbines and wind turbines.

Time waveform vs spectrum: how to read vibration data​

A vibration reading starts as a time waveform: the sensor's signal over a fraction of a second or a few seconds. It shows impacts, rubs and beats directly, but a running machine mixes dozens of sources into one trace, so it's hard to pick them apart by eye.

The spectrum separates them. A fast Fourier transform (FFT) turns the waveform into a list of frequencies and their amplitudes, and each source in the machine shows up as a peak at its own frequency. Analysts usually look at the velocity spectrum for machine faults and the acceleration spectrum for bearings and gears.

Three settings decide what a spectrum can show:

  • Maximum frequency (Fmax). The data must be sampled at more than twice Fmax. For general machine faults, a common rule of thumb sets Fmax at about 40 to 50 times the running speed; bearing and gear work needs several kilohertz.
  • Lines of resolution. The spectrum's frequency spacing is Fmax divided by the number of lines (400 to 12,800 is common). Finer spacing needs a longer recording: 1,600 lines up to 1,000 Hz is a spacing of 0.625 Hz and needs 1.6 s of data.
  • Window and averaging. A window function (usually Hann) keeps a peak from smearing across the spectrum, and averaging several spectra steadies the noise.

Orders: 1×, 2× and harmonics​

Most vibration in a machine repeats once per revolution of a shaft, or a whole number of times per revolution. So analysts measure frequency in orders, multiples of the shaft speed:

  • 1× is the running speed: 1,800 rpm is 30 Hz, so 1× is 30 Hz.
  • 2×, 3× and so on are its harmonics, at 60 Hz, 90 Hz and so on.
  • A peak at a whole order comes from something on that shaft; a peak that isn't on an order comes from something else, such as a bearing, a belt, a gear on another shaft or the electrical supply.

Speeds change slightly with load, so the first step in reading a spectrum is to find the 1× peak and mark its harmonics. Many analysers can show the frequency axis directly in orders.

Common vibration fault signatures​

Each common machine fault leaves its own signature in the spectrum, usually at a particular multiple of the shaft speed or at a bearing defect frequency.

Six idealised spectra, frequency in orders of shaft speed. 1, healthy machine: small peaks at 1x and 2x. 2, imbalance: one dominant 1x peak. 3, misalignment: a 2x peak taller than 1x, with a 3x peak. 4, mechanical looseness: a long row of harmonics with half orders between them. 5, outer-race bearing defect in the envelope spectrum: peaks at BPFO, about 3.6x, and at 2x and 3x BPFO, between the whole orders. 6, gear tooth wear: a peak at the gear mesh frequency with sidebands spaced at the shaft speed

FaultWhere it shows in the spectrumOther clues
Imbalance (mass not centred on the shaft)A high 1× peak, mostly radial; few harmonicsSteady phase; the imbalance force rises with the square of speed
Misalignment (shafts not in line across a coupling)High 2× (often above 1×), with 1× and 3×High axial vibration; phase differs by about 180° across the coupling
Mechanical looseness (loose foot, cracked base, worn fit)Many harmonics of 1×, often to 10× or more, sometimes with half orders (0.5×, 1.5×)Changes from point to point; a clipped or erratic time waveform
Rolling-element bearing defectLines at the bearing's defect frequencies (BPFO, BPFI, BSF, FTF) and their harmonics, which aren't whole ordersEarly on, only in the high-frequency band or the envelope spectrum; high crest factor; impacts in the time waveform
Gear wear or a damaged toothThe gear mesh frequency (number of teeth × shaft speed) and its harmonics, with sidebands spaced at the faulty gear's 1×A cracked or broken tooth gives one impact per revolution of its gear
Electrical faults in AC motorsA peak at twice the supply frequency (100 Hz on 50 Hz mains, 120 Hz on 60 Hz)Disappears the instant the power is cut, while mechanical vibration dies away with the speed
Resonance (running near a natural frequency)A 1× or other peak far higher than its cause explainsChanges sharply with small speed changes; confirm with a run-up or coast-down

The spectrum narrows down the possibilities; the analyst confirms with the time waveform, the direction (horizontal, vertical or axial), phase readings, and what has changed since the last reading.

Bearing defect frequencies: BPFO, BPFI, BSF and FTF​

A ball or roller bearing has four parts that can be damaged, and each produces impacts at its own rate when a rolling element passes the damage. For a bearing with nn rolling elements of diameter dd on a pitch circle of diameter DD, contact angle ϕ\phi and shaft frequency frf_r:

BPFO=n2fr(1−dDcos⁡ϕ)BPFI=n2fr(1+dDcos⁡ϕ)\mathrm{BPFO} = \frac{n}{2} f_r \left(1 - \frac{d}{D}\cos\phi\right) \qquad \mathrm{BPFI} = \frac{n}{2} f_r \left(1 + \frac{d}{D}\cos\phi\right) BSF=D2dfr(1−(dDcos⁡ϕ)2)FTF=fr2(1−dDcos⁡ϕ)\mathrm{BSF} = \frac{D}{2d} f_r \left(1 - \left(\frac{d}{D}\cos\phi\right)^2\right) \qquad \mathrm{FTF} = \frac{f_r}{2} \left(1 - \frac{d}{D}\cos\phi\right)
  • BPFO, the ball pass frequency outer race: a defect on the outer race. The outer race is usually still, so the impacts are evenly spaced.
  • BPFI, the ball pass frequency inner race: a defect on the inner race, which turns with the shaft, so the impacts are stronger when the defect passes through the load zone and the peaks carry sidebands at 1×.
  • BSF, the ball spin frequency: a defect on a rolling element. It strikes both races once per spin, so 2 × BSF is often the stronger line.
  • FTF, the fundamental train frequency: the speed of the cage. It appears as sidebands around the other frequencies.

A worked example, with the 6205-size deep-groove ball bearing used in the demo (9 balls of 7.94 mm on a 39.04 mm pitch circle, contact angle 0) on a shaft at 1,800 rpm (30 Hz): BPFO is 3.585 × 30 = 107.5 Hz, BPFI is 5.415 × 30 = 162.5 Hz, BSF is 2.357 × 30 = 70.7 Hz and FTF is 0.398 × 30 = 11.9 Hz. None of them is a whole order, which is how they're told apart from shaft faults. In practice the balls slip slightly, so the measured frequencies are usually 1 to 2% off the calculated ones.

Envelope analysis for bearing faults​

A small bearing defect makes short, weak impacts. In a velocity spectrum, their energy at the defect frequency is tiny next to the 1× peak, and the overall level hardly moves. But each impact rings the bearing housing at its own natural frequencies, typically a few kilohertz, where little else in the machine vibrates.

Envelope analysis (also called demodulation) uses that ringing:

  1. Band-pass filter the acceleration signal around the excited resonance, for example 2 to 5 kHz.
  2. Take its envelope, the outline of the ringing bursts, with a rectifier and low-pass filter or the Hilbert transform.
  3. Take the spectrum of the envelope. Its lines are the rate at which the impacts repeat: BPFO and its harmonics for an outer-race defect, BPFI with 1× sidebands for an inner-race defect.

Randall and Antoni's tutorial on bearing diagnostics calls envelope analysis the benchmark method, and describes how to choose the band with spectral kurtosis.

Run-up, coast-down and waterfall plots​

A single spectrum is a snapshot at one speed. Starting or stopping a machine sweeps its speed through a range, and plotting a spectrum every fraction of a second gives a waterfall plot (spectra stacked in 3D) or a spectrogram (frequency against time, with amplitude as colour).

  • Order lines (1×, 2×, gear mesh) move diagonally as the speed changes.
  • A natural frequency stays at the same frequency. Where an order line crosses it, the amplitude jumps, which marks a critical speed to avoid running at.
  • Machinery analysts also plot 1× amplitude and phase against speed, which they call a Bode plot; the phase swings by about 180° through a resonance.

The same views suit machines whose speed varies all the time, such as wind turbines and variable-speed drives.

The overall level (the RMS over a band) is one number per measurement point, cheap to collect and easy to trend. Plotted over weeks or months, it shows:

  • A slow rise: wear, a loosening fit, a growing imbalance from dirt on a fan.
  • A step: a change in the machine, a repair, or a measurement problem.
  • A rise then a fall: often a bearing late in its life, as the sharp defect edges wear smooth before the bearing fails.

Set alarms per point, from the ISO zones or from the machine's own baseline (a common rule of thumb is 2 to 2.5 times its normal level), and look at the spectrum whenever one trips. Trend a high-frequency or envelope value beside the velocity overall.

Vibration analysis vs other condition monitoring methods​

Vibration analysis is the main condition monitoring method for rotating machines, and oil analysis, thermography, ultrasound and motor current analysis each catch faults it can miss.

Vibration analysisOil analysisInfrared thermographyUltrasound (airborne and contact)Motor current analysis
What it measuresMachine motion, by frequencyWear particles, contamination and the oil's conditionSurface temperaturesHigh-frequency sound, 20 to 100 kHzThe motor's supply current, by frequency
Best at findingImbalance, misalignment, looseness, bearing and gear faults, resonanceWear inside gearboxes and engines, lubricant problemsElectrical hot spots, overheating bearings, insulation and steam lossesEarly bearing damage, poor lubrication, leaks, electrical dischargeBroken rotor bars and other motor faults, load changes
Machines it suitsAny rotating machineOil-lubricated machinesElectrical panels, motors, process equipmentSlow machines, valves, steam traps, compressed airElectric motors and what they drive
Use it whenYou want to know what is wrong in a rotating machine, and how badlyThe oil is the best witness, as in large gearboxesYou need a quick, non-contact scan of many assetsSpeeds are too low for vibration, or you are listening for leaksThe machine is hard to reach; the current can be measured at the panel

Most programmes combine them. Vibration finds and identifies the fault, and oil analysis or thermography confirm it.

Common vibration analysis mistakes​

Most vibration analysis mistakes come from trusting one number, guessing the running speed or using too coarse a spectrum.

  • Trusting the overall level alone. An early bearing defect can leave the velocity overall in zone A. Add a high-frequency or envelope measurement, and look at the crest factor.
  • Guessing the running speed. Induction motors slip, so a motor rated 1,800 rpm may run at 1,780. Find the true 1× in the spectrum, or measure it with a tachometer, before naming peaks as orders or bearing frequencies.
  • Not enough resolution. Twice the supply frequency (120 Hz) and 4× of a motor running at 1,780 rpm (118.7 Hz) are only 1.3 Hz apart, so a coarse spectrum shows them as one peak. Use more lines, or zoom in on the band.
  • Fmax too low. Bearing and gear frequencies, and the resonances that envelope analysis needs, sit well above 1 kHz. A 10 to 1,000 Hz spectrum can't show them.
  • Mixing up peak, peak-to-peak and RMS. The same vibration reads 1.41 times higher as peak than as RMS, and twice that as peak-to-peak. Check the units before comparing with a limit or another reading.
  • Changing how you measure. A different point, direction or sensor mounting changes the reading. A magnet on a curved, painted surface cuts the high-frequency response that a stud-mounted sensor keeps. Measure the same way every time, or the trend means nothing.
  • Ignoring the time waveform. Impacts, rubs and beats that a spectrum smears out are plain in the waveform.

How to plot a vibration spectrum in JavaScript, React or Angular​

The demo below simulates a motor with a 6205-size bearing and, every time you move a control, recomputes everything in the browser and redraws all three charts: a 16,384-sample acceleration waveform at 12,800 samples per second, its Hann-windowed velocity spectrum, and the envelope spectrum of the 2 to 5 kHz band.

Change the Shaft speed and watch the order markers and bearing frequencies move. Pick a Fault: imbalance raises 1×, misalignment 2×, and looseness a row of harmonics, while the outer-race bearing fault puts impacts in the waveform and clear BPFO lines in the envelope spectrum and barely changes the overall level. Turn up the Severity and the Noise, and switch the ISO 20816-3 limits to see the same reading fall in a different zone. Scroll to zoom, drag to pan, double-click to reset, and hover for values.

Here is the code for this demo. The machine simulation, the FFT and the envelope analysis are plain JavaScript; SciChart.js draws the waveform, the two spectra and the frequency markers.

// Vibration analysis of a rotating machine: time waveform, velocity spectrum with order markers,
// and envelope spectrum with bearing defect frequencies, charted with SciChart.js
const {
SciChartSurface,
NumericAxis,
NumberRange,
EAutoRange,
EXyDirection,
ELabelPlacement,
FastLineRenderableSeries,
FastMountainRenderableSeries,
XyDataSeries,
VerticalLineAnnotation,
SciChartJsNavyTheme,
CursorModifier,
MouseWheelZoomModifier,
ZoomPanModifier,
ZoomExtentsModifier
} = SciChart;
// or, for npm, import { SciChartSurface, ... } from "scichart"

// --- DSP helpers (plain JavaScript, no library needed) ---

// In-place radix-2 FFT (re and im have a power-of-two length)
function fft(re, im) {
const n = re.length;
for (let i = 1, j = 0; i < n; i++) {
let bit = n >> 1;
for (; j & bit; bit >>= 1) j ^= bit;
j ^= bit;
if (i < j) {
[re[i], re[j]] = [re[j], re[i]];
[im[i], im[j]] = [im[j], im[i]];
}
}
for (let size = 2; size <= n; size *= 2) {
const half = size / 2;
const step = (-2 * Math.PI) / size;
for (let start = 0; start < n; start += size) {
for (let k = 0; k < half; k++) {
const wr = Math.cos(step * k);
const wi = Math.sin(step * k);
const a = start + k;
const b = a + half;
const tr = re[b] * wr - im[b] * wi;
const ti = re[b] * wi + im[b] * wr;
re[b] = re[a] - tr;
im[b] = im[a] - ti;
re[a] += tr;
im[a] += ti;
}
}
}
}

// Amplitude spectrum with a Hann window, scaled so a sine of RMS value A shows a peak of about A.
// Returns one RMS amplitude per frequency bin, from 0 Hz to half the sample rate.
function rmsSpectrum(values) {
const n = values.length;
const re = new Float64Array(n);
const im = new Float64Array(n);
const mean = values.reduce((sum, v) => sum + v, 0) / n;
let windowSum = 0;
for (let i = 0; i < n; i++) {
const w = 0.5 - 0.5 * Math.cos((2 * Math.PI * i) / n);
windowSum += w;
re[i] = (values[i] - mean) * w;
}
fft(re, im);
const amplitudes = new Float64Array(n / 2 + 1);
for (let k = 1; k <= n / 2; k++) amplitudes[k] = (2 * Math.hypot(re[k], im[k])) / windowSum / Math.SQRT2;
return amplitudes;
}

// Acceleration spectrum (g RMS) to velocity spectrum (mm/s RMS): divide each line by 2 pi f.
// Lines below 5 Hz are left out, where dividing by a small f would only magnify noise.
function toVelocity(accelerationG, binHz) {
return accelerationG.map((a, k) => (k * binHz < 5 ? 0 : (a * 9.80665 * 1000) / (2 * Math.PI * k * binHz)));
}

// Overall vibration: the RMS of all lines from 10 to 1000 Hz (the band ISO 20816-3 uses for machines
// above 600 r/min). Dividing by 1.5 removes the Hann window's spreading of each line over about 1.5 bins.
function overallRms(velocity, binHz) {
let sum = 0;
for (let k = 0; k < velocity.length; k++) {
const f = k * binHz;
if (f >= 10 && f <= 1000) sum += velocity[k] * velocity[k];
}
return Math.sqrt(sum / 1.5);
}

// Envelope analysis for bearing faults: keep only a band around the housing resonance that the impacts
// excite, take the envelope (the magnitude of the analytic signal, via the Hilbert transform), then take
// the spectrum of the envelope. The impacts' repetition rate shows up as clean lines.
function envelopeSpectrum(values, lowHz, highHz) {
const n = values.length;
const re = Float64Array.from(values);
const im = new Float64Array(n);
fft(re, im);
for (let k = 0; k < n; k++) {
const f = (k * SAMPLE_RATE) / n;
// positive frequencies inside the band are doubled; everything else, negative frequencies included, is zeroed
const keep = k < n / 2 && f >= lowHz && f <= highHz ? 2 : 0;
re[k] *= keep;
im[k] *= keep;
}
// Inverse FFT with the forward one: conjugate, FFT, conjugate again and divide by n
for (let k = 0; k < n; k++) im[k] = -im[k];
fft(re, im);
const envelope = new Float64Array(n);
for (let i = 0; i < n; i++) envelope[i] = Math.hypot(re[i], im[i]) / n;
return rmsSpectrum(envelope);
}

// Bearing defect frequencies, as multiples of the shaft speed (orders)
function bearingOrders({ balls, ballDiameter, pitchDiameter, contactAngleDeg }) {
const r = (ballDiameter / pitchDiameter) * Math.cos((contactAngleDeg * Math.PI) / 180);
return {
FTF: 0.5 * (1 - r), // cage (fundamental train)
BSF: (pitchDiameter / (2 * ballDiameter)) * (1 - r * r), // ball spin
BPFO: (balls / 2) * (1 - r), // ball pass, outer race
BPFI: (balls / 2) * (1 + r) // ball pass, inner race
};
}

// ISO 20816-3 zone boundaries A/B, B/C and C/D, velocity in mm/s RMS
const isoLimits = {
"2r": [1.4, 2.8, 4.5],
"2f": [2.3, 4.5, 7.1],
"1r": [2.3, 4.5, 7.1],
"1f": [3.5, 7.1, 11.0]
};
const zones = [
{ name: "A", meaning: "as new", colour: "#2ECC71" },
{ name: "B", meaning: "acceptable long term", colour: "#C6E05A" },
{ name: "C", meaning: "unsatisfactory: plan a repair", colour: "#F5A623" },
{ name: "D", meaning: "damage likely", colour: "#FF4D4D" }
];

// --- Three charts, one above the other ---
async function createChart(div, title, xTitle, yTitle, xPrecision) {
const { wasmContext, sciChartSurface } = await SciChartSurface.create(div, {
theme: new SciChartJsNavyTheme(),
title,
titleStyle: { fontSize: 14 }
});
const axisTitleStyle = { fontSize: 14 };
const xAxis = new NumericAxis(wasmContext, {
axisTitle: xTitle,
axisTitleStyle,
autoRange: EAutoRange.Never,
labelPrecision: xPrecision
});
sciChartSurface.xAxes.add(xAxis);
const yAxis = new NumericAxis(wasmContext, {
axisTitle: yTitle,
axisTitleStyle,
autoRange: EAutoRange.Always,
growBy: new NumberRange(0.05, 0.1),
labelPrecision: 2
});
sciChartSurface.yAxes.add(yAxis);
const dataSeries = new XyDataSeries(wasmContext, { dataIsSortedInX: true, containsNaN: false });
const chart = { sciChartSurface, wasmContext, xAxis, yAxis, dataSeries, defaultRange: new NumberRange(0, 1) };
// Scroll to zoom, drag to pan (both along x); double-click to go back to the default range
sciChartSurface.chartModifiers.add(
new CursorModifier({ showTooltip: true, showYLine: false }),
new MouseWheelZoomModifier({ xyDirection: EXyDirection.XDirection }),
new ZoomPanModifier({ xyDirection: EXyDirection.XDirection }),
new ZoomExtentsModifier({
xyDirection: EXyDirection.XDirection,
onZoomExtents: () => {
xAxis.visibleRange = chart.defaultRange;
return false;
}
})
);
return chart;
}

const waveform = await createChart(ui.waveformDiv, "Time waveform (acceleration)", "Time (s)", "Accel. (g)", 2);
waveform.sciChartSurface.renderableSeries.add(
new FastLineRenderableSeries(waveform.wasmContext, {
dataSeries: waveform.dataSeries,
stroke: "#50C7E0",
strokeThickness: 1
})
);

const spectrum = await createChart(ui.spectrumDiv, "Velocity spectrum (RMS)", "Frequency (Hz)", "Velocity (mm/s)", 0);
const envelope = await createChart(
ui.envelopeDiv,
"Envelope spectrum (2–5 kHz band)",
"Frequency (Hz)",
"Envelope (g)",
0
);
envelope.yAxis.autoRange = EAutoRange.Never; // set in update()
for (const chart of [spectrum, envelope]) {
chart.sciChartSurface.renderableSeries.add(
new FastMountainRenderableSeries(chart.wasmContext, {
dataSeries: chart.dataSeries,
stroke: "#50C7E0",
strokeThickness: 2,
fill: "#50C7E033"
})
);
}

// Frequency markers: a dashed vertical line with a label, moved whenever the shaft speed changes
function addMarker(chart, label, colour, placement) {
const marker = new VerticalLineAnnotation({
x1: 0,
stroke: colour,
strokeThickness: 1,
strokeDashArray: [4, 4],
showLabel: true,
labelPlacement: placement,
labelValue: label,
axisLabelFill: colour, // the label text colour when the label sits beside the line
axisFontSize: 12
});
chart.sciChartSurface.annotations.add(marker);
return marker;
}
const bearing = bearingOrders(BEARING);
const orderGrey = "#C8D3E8";
const spectrumMarkers = [1, 2, 3, 4, 5, 6, 7, 8].map((order) => ({
order,
marker: addMarker(spectrum, `${order}×`, orderGrey, ELabelPlacement.TopRight)
}));
spectrumMarkers.push({
order: bearing.BPFO,
marker: addMarker(spectrum, "BPFO", "#F48420", ELabelPlacement.BottomRight)
});
const envelopeMarkers = [
{ order: 1, marker: addMarker(envelope, "1×", orderGrey, ELabelPlacement.TopRight) },
{ order: bearing.BSF, marker: addMarker(envelope, "BSF", "#F5E663", ELabelPlacement.TopRight) },
{ order: bearing.BPFO, marker: addMarker(envelope, "BPFO", "#F48420", ELabelPlacement.TopRight) },
{ order: bearing.BPFI, marker: addMarker(envelope, "BPFI", "#E36FD8", ELabelPlacement.TopRight) },
{ order: 2 * bearing.BPFO, marker: addMarker(envelope, "2×BPFO", "#F48420", ELabelPlacement.TopRight) },
{ order: 3 * bearing.BPFO, marker: addMarker(envelope, "3×BPFO", "#F48420", ELabelPlacement.TopRight) }
];

// Replace a data series' values
function setData(dataSeries, x, y) {
dataSeries.clear();
dataSeries.appendRange(Array.from(x), Array.from(y));
}

// --- The controls: every change re-simulates the machine, reruns the analysis and redraws ---
let lastRpm = 0;
function update() {
const rpm = Number(ui.rpmInput.value);
const fault = ui.faultSelect.value;
const severity = Number(ui.severityInput.value) / 100;
const noiseLevel = Number(ui.noiseInput.value) / 100;
const shaftHz = rpm / 60;
ui.rpmOutput.textContent = `${rpm} rpm (${shaftHz.toFixed(1)} Hz)`;
ui.severityOutput.textContent = `${Math.round(severity * 100)}%`;
ui.noiseOutput.textContent = `${Math.round(noiseLevel * 100)}%`;
ui.severityInput.disabled = fault === "healthy";

// 1. The time waveform, in g
const { x, y } = simulateMachine(rpm, fault, severity, noiseLevel);
setData(waveform.dataSeries, x, y);

// 2. The velocity spectrum, from 0 to half the sample rate (zoom out to see it all)
const binHz = SAMPLE_RATE / SAMPLE_COUNT;
const frequencies = Array.from({ length: SAMPLE_COUNT / 2 + 1 }, (_, k) => k * binHz);
const velocity = toVelocity(rmsSpectrum(y), binHz);
setData(spectrum.dataSeries, frequencies, velocity);

// 3. The envelope spectrum of the 2 to 5 kHz band. Its y-axis never shrinks below 0.05 g, so the
// noise floor of a machine without impacts stays flat instead of being scaled up to fill the chart.
const envelopeValues = envelopeSpectrum(y, 2000, 5000);
setData(envelope.dataSeries, frequencies, envelopeValues);
let envelopeMax = 0.05;
for (let k = 1; k * binHz < 15 * shaftHz; k++) envelopeMax = Math.max(envelopeMax, envelopeValues[k]);
envelope.yAxis.visibleRange = new NumberRange(0, 1.15 * envelopeMax);

// Markers follow the shaft speed; the default views show the first 10 and 12 orders
for (const { order, marker } of spectrumMarkers) marker.x1 = order * shaftHz;
for (const { order, marker } of envelopeMarkers) marker.x1 = order * shaftHz;
waveform.defaultRange = new NumberRange(0, 0.25);
spectrum.defaultRange = new NumberRange(0, 10 * shaftHz);
envelope.defaultRange = new NumberRange(0, 12 * shaftHz);
if (rpm !== lastRpm) {
for (const chart of [waveform, spectrum, envelope]) chart.xAxis.visibleRange = chart.defaultRange;
lastRpm = rpm;
}

// The readout: overall level and its ISO zone, peak acceleration and crest factor
const overall = overallRms(velocity, binHz);
const limits = isoLimits[ui.isoSelect.value];
const zone = zones[limits.filter((limit) => overall >= limit).length];
let peak = 0;
let squares = 0;
for (const value of y) {
peak = Math.max(peak, Math.abs(value));
squares += value * value;
}
const crestFactor = peak / Math.sqrt(squares / y.length);
ui.summary.innerHTML =
`Overall velocity <b>${overall.toFixed(2)} mm/s RMS</b> (10–1000 Hz): ` +
`<span style="color:${zone.colour}; font-weight:600">zone ${zone.name}, ${zone.meaning}</span>` +
` · Peak ${peak.toFixed(2)} g · Crest factor ${crestFactor.toFixed(1)}` +
` · 1× = ${shaftHz.toFixed(1)} Hz · BPFO = ${(bearing.BPFO * shaftHz).toFixed(1)} Hz`;
}

for (const input of [ui.rpmInput, ui.severityInput, ui.noiseInput]) input.addEventListener("input", update);
for (const select of [ui.faultSelect, ui.isoSelect]) select.addEventListener("change", update);
update();

Key points:

  • The spectrum is a FastMountainRenderableSeries over an XyDataSeries of frequency and amplitude. A spectrum of 8,193 lines, or a waveform of 16,384 samples, is redrawn in full on every change; no downsampling is needed.
  • Order and bearing markers are VerticalLineAnnotations with showLabel and labelValue. Setting each marker's x1 when the speed changes moves it without rebuilding the chart.
  • The waveform and velocity spectrum y-axes use EAutoRange.Always, so they rescale to each new reading, while the x-axes keep the band you zoomed to. The envelope spectrum's y-axis has a floor of 0.05 g, so a machine with no impacts shows a flat noise floor instead of noise scaled up to fill the chart. A ZoomExtentsModifier with an onZoomExtents callback resets each chart to its default band.
  • The FFT, the velocity conversion and the envelope analysis are a few dozen lines of plain JavaScript. For a live feed, compute a new spectrum per block of samples and replace the data series' values.

See it in the demo app: JavaScript audio analyzer · React audio analyzer · Angular audio analyzer. Related techniques: the React interactive waterfall chart, React 3D waterfall spectral chart, React heatmap chart and React synchronised multi-chart.

Go deeper: SciChart.js line chart documentation, the mountain (area) chart, the vertical line annotation, the uniform heatmap for spectrograms, and the learning center guides to the fast Fourier transform, window functions, power spectral density and the Hilbert transform. For the industries, see SciChart for instrumentation, aerospace and defence and HMI and SCADA.

Frequently asked questions​

What is vibration analysis?​

Vibration analysis is a way of checking a machine's health from the way it shakes. Sensors on the bearings record vibration, software turns it into a time waveform and a frequency spectrum, and analysts look for the patterns that faults leave, such as a high peak at the shaft speed for imbalance. It lets maintenance teams find faults early and plan repairs before a breakdown.

What are the three types of vibration measurement?​

Vibration is measured as displacement, velocity or acceleration. Displacement, in micrometres peak-to-peak, suits low frequencies and shaft movement in sleeve bearings. Velocity, in mm/s RMS, is used for overall machine condition and the ISO severity limits. Acceleration, in g, suits high frequencies, where bearing and gear faults show first.

What is 1× and 2× in vibration analysis?​

1× is the vibration at the shaft's running speed, once per revolution: 30 Hz for a shaft at 1,800 rpm. 2× is twice the running speed, 3× three times, and so on. A high 1× usually means imbalance, a high 2× often means misalignment, and a long row of harmonics suggests mechanical looseness.

What are BPFO and BPFI?​

BPFO and BPFI are the ball pass frequencies of the outer and inner race of a rolling-element bearing: the rate at which balls or rollers pass a defect on that race. They depend on the shaft speed and the bearing's geometry, and are not whole multiples of the shaft speed. For a 6205-size ball bearing, BPFO is about 3.59 times and BPFI about 5.42 times the shaft speed.

What is an acceptable vibration level for a motor or pump?​

ISO 20816-3 gives zone limits in mm/s RMS, measured on the bearing housings over 10 to 1,000 Hz. For a medium-sized machine of 15 to 300 kW on a rigid base, below 1.4 mm/s is as new, up to 2.8 mm/s is acceptable long term, 2.8 to 4.5 mm/s needs a planned repair, and above 4.5 mm/s risks damage. Larger machines and flexible mounts have higher limits.

How do I plot a vibration spectrum in JavaScript?​

Compute the spectrum with an FFT of a windowed block of samples, scale it to the units you need, such as velocity in mm/s RMS, and plot frequency against amplitude. With SciChart.js, put the result in an XyDataSeries, draw it with a FastMountainRenderableSeries, and add a VerticalLineAnnotation for each shaft order and bearing frequency. The same code works in React with scichart-react and in Angular with scichart-angular.

Sources​