A vibration spectrogram can show a change at the beginning or end of a robot log even when the recorded signal is steady. Each column describes a window of samples. When that window extends past the available data, a transform can fill the missing portion with zeros. The column still has a time label, so a dashboard that displays only the spectrum and time can hide how much of the window came from the sensor.

Use a constant signal to identify the edge columns

SciPy's ShortTimeFFT places windows at a regular hop and includes slices that touch the signal. In the fixture below, each sample is one, the rectangular window is four samples wide, and the hop is two samples. The zero-frequency coefficient of an unscaled forward transform equals the sum of the windowed samples. A complete window therefore returns four. A window with two real samples and two zeros returns two.

import numpy as np

from scipy.signal import ShortTimeFFT

x = np.ones(12)

sft = ShortTimeFFT(np.ones(4), hop=2, fs=100.0)

spectrum = sft.stft(x, padding="zeros")

times_s = sft.t(len(x))

np.testing.assert_allclose(

spectrum[0].real, [2, 4, 4, 4, 4, 4, 2]

)

np.testing.assert_allclose(times_s, np.arange(7) * 0.02)

The fixture returned those seven columns. The first is labeled zero seconds while the last is labeled 0.12 seconds, one sample interval past the final recorded point at 0.11 seconds. The two edge values reflect the available window support. In a plotted power spectrum the difference is squared, so the zero-frequency power at the edges is a quarter of the interior value for this fixture.

Keep the support flag beside the time label

Use the slice-index component of lower_border_end and upper_border_begin(n) to distinguish fully supported slices from slices affected by padding. In a full transform, subtract p_min when converting a slice index to a column offset. The fixture's fully supported slices are 1 through 5. If a job requests only a subset of slices, use its actual starting slice as the offset instead.

Carry that flag into any threshold or trend rule that assumes a full captured window. A human-facing chart can shade affected columns while retaining their time labels and spectral values. Save the sample rate, window, hop, and padding mode with the report so those columns can be reconstructed when an engineer reviews a boundary event.

Sources

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

https://numpy.org/doc/stable/reference/routines.fft.html