A vibration review can show a coherence value of 1 at every frequency even when two sensors have no shared signal. Before treating a flat line at 1 as evidence of a common vibration source, check how many segments entered the estimate. A one-segment estimate has no repeated observations with which to check whether the relationship holds.

Why the segment count matters

Magnitude-squared coherence compares the squared magnitude of the cross spectrum with the product of the two power spectra. With one segment, write the windowed Fourier coefficients at a frequency as X and Y. The cross-spectrum term is proportional to the conjugate of X multiplied by Y. Its squared magnitude equals the product of the squared magnitudes of X and Y. With the same window and scaling for both channels, those factors cancel and the ratio is 1 wherever both channels have nonzero power, apart from rounding. Where either power is zero, the ratio is undefined.

With multiple segments, the cross products are averaged before taking their squared magnitude. Cross products with different phases can cancel, while the powers of the two channels are averaged separately and remain nonnegative. A repeated phase relationship can therefore survive averaging in a way that a chance alignment in one segment cannot demonstrate.

Reproduce the difference with two noise sequences

This example generates two independent synthetic noise sequences of 4,096 samples each. Both calls use a Hann window and no overlap. At a sample rate of 256 Hz, the second call uses sixteen one-second segments. The two frequency grids differ, so compare 32 Hz where both grids contain an exact bin.

import numpy as np

from scipy.signal import coherence

rng = np.random.default_rng(42)

x = rng.normal(size=4096)

y = rng.normal(size=4096)

f_one, c_one = coherence(x, y, fs=256, window="hann", nperseg=4096, noverlap=0)

f_many, c_many = coherence(x, y, fs=256, window="hann", nperseg=256, noverlap=0)

print(c_one[f_one == 32][0], c_many[f_many == 32][0])

assert np.allclose(c_one, 1)

assert c_many[f_many == 32][0] < 0.1

With SciPy 1.18.1 and NumPy 2.5.5, the single-segment estimate at 32 Hz is 1.0 and the sixteen-segment estimate is approximately 0.016. This result is specific to the example. A low value from this run is not a universal significance threshold.

Record the settings with each comparison

For a robot test, first align the measurement channels and select a time interval with a comparable operating condition. Keep the sample rate, segment length, window, overlap, and frequency spacing in the record. Save the segment count as well. Zero-padding can make the frequency grid finer, but it does not add segments. Overlapping segments share samples, so their raw count should not be treated as a count of independent observations.

If a coherence peak persists after averaging, compare it with the channel spectra and the operating conditions. Two locations can share a motor or another excitation source. A high value by itself does not identify which sensor location or component caused the vibration.

Sources

SciPy documentation on the magnitude-squared coherence estimator and its segment settings

https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.coherence.html

SciPy documentation on conjugate cross products and averaging across time slices

https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.csd.html