Forbach & Partners DE Book a call

FFT in vibration analysis: sampling rate, resolution and window function for practitioners

A spectrum is only as good as the decisions made before it. Sampling rate, window length and window function determine whether two closely spaced bearing frequencies appear as two lines or as one blurred hump.

Almost every vibration diagnosis on machines starts with the same calculation: the fast Fourier transform, or FFT. It breaks a time signal down into its frequency components and turns a noisy trace into a spectrum with clear lines. The FFT itself is standard and is included in every maths library. Whether the result is usable, however, is decided beforehand: by the sampling rate, window length, window function and scaling. This article explains these FFT settings in vibration analysis for practitioners and shows how we use them in our system for CNC spindles.

Sampling rate and Nyquist: what can be seen at all

A vibration sensor delivers a continuous signal. The data acquisition card samples it at fixed time intervals. The number of values per second is the sampling rate fs. This gives the most important limit of the entire analysis: a spectrum extends at most to half the sampling rate, the Nyquist frequency.

f_Nyquist = f_s / 2 Example (assumption): f_s = 51,200 Hz → spectrum up to 25,600 Hz f_s = 1,000 Hz → spectrum up to 500 Hz

Frequencies above this limit do not simply disappear. If they are not filtered out before sampling, they appear mirrored at a wrong, lower position in the spectrum. This effect is called aliasing. Data acquisition cards for vibration therefore have an analogue low-pass filter ahead of the converter. An aliasing error cannot be corrected afterwards.

In practice this means the sampling rate must match the frequencies you want to see. For rolling bearings, these are not only the defect frequencies themselves, but above all the structural resonances excited by the impacts of a bearing defect. These are usually in the kilohertz range. Our simulator provides vibration windows at 51.2 kHz, and the data acquisition interface of the edge box is designed for accelerometers up to this sampling rate.

Frequency resolution: window length decides

The FFT always processes a piece of signal of fixed length, the measurement window. This window produces a spectrum with lines at equal spacing. This spacing is the frequency resolution:

Δf = f_s / N = 1 / T N = number of samples in the window T = window duration in seconds

So the resolution depends only on the duration of the window, not on the sampling rate alone. A high sampling rate extends the frequency range upwards. Finer resolution can only be achieved with a longer window.

Example values, assuming f_s = 51,200 Hz
Window duration TSamples NResolution ΔfFrequency range
0.25 s12,8004 Hzup to 25,600 Hz
0.5 s25,6002 Hzup to 25,600 Hz
1 s51,2001 Hzup to 25,600 Hz
2 s102,4000.5 Hzup to 25,600 Hz

Longer windows come at a price, however. The speed must remain constant throughout the window, otherwise all speed-dependent lines smear. On a CNC spindle that changes speed with every tool, this is a real limit. Window length is therefore always a compromise between resolution and the time during which the machine runs steadily enough. In our edge box, the window duration can be set per measurement point. A window is only evaluated if the speed was almost the same before and after the measurement.

Why resolution matters for bearing frequencies

Bearing diagnostics looks for lines in the spectrum at calculated positions: outer race (BPFO), inner race (BPFI), rolling element (BSF) and cage (FTF). The formulas are given in the article Detecting rolling bearing damage early. Three situations require sufficiently fine resolution:

  • Sidebands: an inner race defect shows as a line at BPFI with sidebands spaced at the shaft frequency. If the resolution is too coarse, the main line and sidebands merge.
  • Adjacent harmonics: harmonics of different defect types can lie close together. For the assumed bearing from the bearing article, 3 × BPFO is at around 1,936 Hz and 2 × BPFI at around 1,909 Hz, so at 6,000 rpm only about 27 Hz apart.
  • Cage frequency: the FTF lies below the shaft frequency, at around 40 Hz in the example. In absolute terms, low frequencies need fine resolution to stand out from the DC component and the shaft frequency.

Real bearings slip slightly, so the lines are not exactly at the calculated position. Our system therefore searches within a tolerance band around each expected frequency. The band is at least a few per cent of the frequency wide and never narrower than a few spectral lines. We have deliberately built two consequences of this into the analysis. First, a defect is only treated as detected if the fundamental frequency itself is visible, not just a harmonic. Second, the system checks whether an expected frequency and its harmonics are still below the Nyquist limit. If they are above it, they are not evaluated at all, rather than guessing a value.

Window functions and spectral leakage

The FFT assumes that the measurement window repeats endlessly. If a vibration does not fit into the window as a whole number of periods, a discontinuity appears at the join. In the spectrum, the energy of the line is then spread over the neighbouring lines. This is called spectral leakage. A strong line can thus mask a weak neighbouring line, and the amplitude of the strong line is shown too low.

The remedy is a window function. It weights the signal so that it tapers smoothly to zero at the edges of the window. This removes the discontinuity, and the energy stays much more tightly concentrated at the actual line. There are many window functions with different strengths:

WindowStrengthTypical use
Rectangular (no window)sharpest line, but strong leakageImpact measurements, signals that fit exactly into the window
Hanngood compromise between selectivity and low leakageGeneral vibration analysis on machines
Flat topvery accurate amplitude, but broad linesCalibration, amplitude measurement of individual lines

In our system we use the Hann window, both for the ordinary spectrum and for the envelope spectrum. For bearing diagnostics this is the usual choice: lines stay well separated, and weak bearing lines next to the strong shaft frequency are not lost in the leakage. The price is a slightly broader main line, which is absorbed by the tolerance band in the search.

Amplitude scaling: what the number in the spectrum means

A spectrum shows an amplitude on the vertical axis. What exactly this number means is not self-evident. Spectra can be scaled as peak value, as RMS, as power or as power spectral density. Anyone comparing two spectra from different systems needs to know this, otherwise they are comparing apples with oranges.

Our system calculates a single-sided amplitude spectrum, i.e. positive frequencies only. The scaling is chosen so that a pure sine wave appears in the spectrum with its peak value. This involves two corrections:

  • Window correction: the Hann window attenuates the signal at the edges and so lowers the amplitude of all lines. The result is divided by the sum of the window weights so that the amplitude is correct again.
  • Single-sided representation: the FFT splits the energy of a vibration between a positive and a negative frequency. For the single-sided representation the values are doubled. The DC component and the line exactly at the Nyquist frequency have no mirror image and are not doubled.

Even so, the absolute height is not the yardstick for our assessment. It depends on the sensor, its mounting and the transmission path in the spindle housing. What is assessed is the deviation from the learned baseline, i.e. the normal state of the same measurement point. More on this in the article Fixed thresholds or learned baseline.

Averaging and noise

A single spectrum contains random components. Conventional instruments therefore often average several spectra in succession, for example using Welch's method with overlapping sub-windows. The lines remain, the noise becomes smoother. The disadvantage is that averaging over sub-windows reduces the resolution for the same total duration.

Our system does not average within a measurement window. Each window produces exactly one spectrum at full resolution. Robustness against randomness comes in elsewhere:

  • Noise floor as median: whether a line at a bearing frequency stands out is measured by the system against the median of the amplitudes in a band around this frequency. The median is barely influenced by the peaks being searched for. The result is a margin in decibels above the noise.
  • Learned baseline from many measurements: the learned baseline of a spindle is learned from many healthy measurements, using robust measures such as the median and the median absolute deviation instead of mean and standard deviation.
  • Confirmation over several measurements: an alert is only raised if a deviation persists over several consecutive measurements.

This division keeps each individual spectrum sharp and moves the statistical smoothing to where it does not blur the diagnosis.

Why control data below 1 kHz is not enough

Many plants rightly ask whether you could simply use the data the CNC control already provides. For speed, spindle load and operating state, the control is indeed the right source. For bearing diagnostics it is not enough. The standard interfaces of the controls deliver values at well below 1 kHz. According to the Nyquist rule, the spectrum then ends below 500 Hz. The structural resonances on which envelope analysis is based are far above this. At high spindle speeds, even the inner race defect frequencies are already above this limit.

Two sources, two tasks

Our edge box reads the CNC control via OPC UA, read-only, by default once per second and never more often than every 0.1 s. This provides the speed, without which no bearing frequency can be calculated. The vibration signal in the kilohertz range comes from a sensor on the spindle housing. The FFT and envelope analysis run directly on the edge box. Only the features are transmitted.

For the envelope, the signal is first band-pass filtered around the resonance. We use a Butterworth filter for this, applied forwards and backwards so that it introduces no phase shift. The envelope is obtained via the Hilbert transform. The appropriate frequency band is set per measurement point. The path from raw signal to alert is described in the article From vibration to alert. How the edge box is built is covered under Edge box for condition monitoring, and how the data is protected under Data security.

Frequently asked questions

What sampling rate do you need for rolling bearing vibration analysis?

A sampling rate whose half value is well above the structural resonances excited by a bearing defect. These are usually in the kilohertz range. Our simulator works at 51.2 kHz. Which rate makes sense on a particular spindle depends on the data acquisition card, sensor and measurement point.

How do you calculate the frequency resolution of an FFT?

Sampling rate divided by the number of samples in the window, or more simply: one divided by the window duration in seconds. A one-second window gives a resolution of 1 Hz, regardless of the sampling rate.

Why use a Hann window for the FFT?

Because a signal rarely fits into the measurement window as a whole number of periods. Without a window, the energy of a line spreads to its neighbours: spectral leakage. The Hann window greatly reduces this effect and keeps lines well separated. The amplitude must then be corrected for the window loss.

Is CNC control data enough for an FFT analysis of the spindle bearings?

No. The standard interfaces deliver well below 1 kHz, so the spectrum ends below 500 Hz. Bearing diagnostics needs signals in the kilohertz range and therefore a vibration sensor on the spindle housing. The control does, however, supply the speed, without which the bearing frequencies cannot be calculated.

What does the amplitude in an FFT spectrum mean?

That depends on the scaling. In our system, a pure sine wave appears with its peak value, corrected for the loss caused by the Hann window. Other systems show RMS values or power spectral densities. Before comparing two systems, you should clarify the scaling.

Sascha P. Forbach

About the author

Sascha P. Forbach is the founder of Forbach & Partners and the software architect of its spindle monitoring system. For twelve years he has advised manufacturers on process quality and machine availability. About us

Next step

Can your control be connected? You will know in 20 minutes.