Skip to main content

Documentation for ScryLab v0.7.1

Changelogs

Spectrum

These operations turn a signal over time into a signal over frequency. All rows of a plot share one x-axis, so place the result in a plot of its own.

You want to seeUse
the exact amplitude of tones in a short, clean recordingFFT
noise and vibration levels, or to compare levels between measurementsPSD
how the frequency content changes over timeSTFT
how a system turns an input into an outputTransfer Function

FFT

Amplitude spectrum of the whole time signal: which frequencies it contains and how strongly. Needs a uniform time axis. For a noisy signal prefer PSD (averaged), for content that changes over time STFT.

Creates a new signal from each selected signal. Needs a time axis.

SettingDescriptionDefault
Output ComponentWhich component of the FFT to output.amplitude · dB · real · imaginary
Only Positive FrequenciesIf enabled, only the positive frequency components will be calculated.on

More under Advanced: Zero Padding, Normalize.

Reading the result

  • amplitude is scaled physically: the peak of a pure tone is its amplitude in the unit of the signal. dB is 20·log₁₀ of that amplitude. real and imaginary keep the phase.
  • No window is applied. A tone that does not fall exactly on a frequency bin leaks into its neighbors and looks lower and wider than it is. For noisy or long recordings PSD is the better tool.
  • Zero Padding only interpolates the frequency axis. The bins look finer, the resolution stays the same.
  • Only Positive Frequencies also drops the constant part at 0 Hz.

Gaps

NaN samples at the edges are cut off and small gaps inside (up to 20 % of the signal) are bridged. A signal that is mostly masked is refused. Slightly uneven sampling is resampled, but a real pause in the recording stops the operation: crop to a section without a pause, or use PSD.

Harmonics

Amplitude of the fundamental and each of its harmonics – power quality, inverters, motor currents. The fundamental is found automatically or given; a flat-top window keeps the amplitudes exact. THD is available as a metric on the time signal.

Creates a new signal from each selected signal. Needs a time axis.

SettingDescriptionDefault
HarmonicsHow many harmonics (incl. the fundamental) – fewer if Nyquist is reached first.40 (1–1000)
FundamentalFrequency of the fundamental. Empty = the strongest spectral line.–
Relative to fundamentalAmplitudes in % of the fundamental instead of the signal’s unit.off

Reading the result

The x-axis is the harmonic number: 1 is the fundamental, 2 the second harmonic and so on. The y-axis is the amplitude (peak value) in the unit of the signal, or in percent of the fundamental. The result is drawn as stems.

Each harmonic is the largest spectral line within a quarter of the fundamental frequency around its expected position, so a slightly wrong fundamental does no harm.

Good to know

  • The flat-top window keeps the amplitudes exact even when a harmonic falls between two frequency bins. It needs about ten periods of the fundamental or more.
  • Gaps are treated as in FFT.
  • The THD is a metric of the time signal, not of this result.

PSD

Power spectral density by Welch’s method: the spectrum averaged over overlapping segments – smoother than one FFT and the right measure for noise and vibration levels. Longer segments give finer frequency resolution. NaN gaps are never bridged.

Creates a new signal from each selected signal. Needs a time axis.

SettingDescriptionDefault
Segment lengthLength of each Welch segment in seconds. Longer → finer frequency bins but fewer averages; shorter → smoother but coarser.1 s (0.001–1000)

More under Advanced: Overlap, Window, Scaling, Logarithmic Display.

Reading the result

A PSD shows power. On the dB scale that is 10·log₁₀ of the power, and the linear unit is unit²/Hz. Phase and the exact amplitude of a single tone are lost in the averaging.

Scaling decides what a level means:

  • density is power per Hz. It does not depend on the segment length, so use it to compare levels between measurements.
  • spectrum is power per frequency bin. The height of a peak is the power of that component.

Choosing the settings

Segment length trades resolution against averaging: longer segments give finer frequency bins but fewer averages and a noisier curve. An overlap of 0.5 is the usual choice. The segments are weighted with a Hann window unless you pick another one.

Good to know

NaN gaps are never bridged. The segments run only inside gap-free sections, and sections shorter than one segment are skipped. PSD therefore also works on masked data, which FFT refuses.

STFT

Spectrogram by the Short-Time Fourier Transform: how the frequency content changes over time (time × frequency × magnitude). Longer segments give finer frequency resolution, shorter ones finer time resolution.

Creates a new signal from each selected signal. Needs a time axis.

SettingDescriptionDefault
Segment lengthLength of each segment in seconds. Controls the frequency resolution: longer segments give finer frequency resolution but coarser time resolution.0.1 s (0.001–1000)
Logarithmic Scale (dB)Display magnitude in decibels (dB). Recommended for audio/vibration data.on
Only Positive FrequenciesIf enabled, only the positive frequency components will be shown.on

More under Advanced: Overlap, Window Function.

Reading the result

The result is a spectrogram: time on x, frequency on y, magnitude as color (in dB unless you switch it off). A spectrogram is read by eye. To put a number on how a frequency moves, set a range on the time signal and read its dominant frequency there.

Choosing the settings

Segment length is the main setting: longer segments resolve frequency finer and time coarser. The overlap (0.5 to 0.75 is common) only smooths the time axis.

Very short segments with a high overlap on a long recording produce an enormous result. Above about 2 GB the operation refuses; use longer segments or less overlap.

Good to know

  • NaN samples at the edges are cut off and small gaps bridged. A real pause in the recording stops the operation: crop to a section without a pause first.
  • Frequency → Order turns the result into an order spectrogram, Time → RPM into a Campbell diagram. Transfer Function Spectrogram is the counterpart for two signals.

Transfer Function

Frequency response between an input and an output signal by Welch’s method (H1 estimator): magnitude, phase, real or imaginary part, or the coherence. Magnitude and phase are colored by the coherence – washed-out means doubtful.

Creates a new signal from: Input, Output. Needs a time axis.

SettingDescriptionDefault
ComponentMagnitude, phase, real or imaginary part of the transfer function – or the coherence γ² (0–1): the per-frequency validity measure of the estimate. Check it before trusting a TF; low coherence = noise/no excitation there.magnitude · phase · real · imaginary · coherence
UnitScale for the magnitude output. ‘dB’ applies 20·log₁₀.linear · dB
StartLower bound of the frequency range shown in the result.0.2 Hz
EndUpper bound of the frequency range shown in the result.3.5 Hz
Segment lengthLength of each Welch segment in seconds. Longer → finer frequency resolution; shorter → more averaging. Capped at the longest gap-free section. Sweep excitation: about 1/3–1/2 of the sweep duration.10 s (0.1–1000)

More under Advanced: Overlap.

Reading the result

The estimate returns a value at every frequency, also where the input did not excite the system: in the noise, or above the end of a sweep. To make that visible, magnitude, phase, real and imaginary part carry the coherence γ² as color. Full color means the value can be trusted, a washed-out curve means it is doubtful. As a rule of thumb, γ² above 0.9 is solid and below 0.7 doubtful. Dips at anti-resonances are normal.

Low coherence at high frequencies usually means that the excitation was too weak there. Other settings do not repair that. State the valid frequency range instead.

The coloring needs at least two averaged segments. With a single segment the coherence is 1 by construction, so the curve stays uncolored and a warning asks you to shorten the segment length.

Choosing the settings

  • Segment length trades frequency resolution against averaging. Longer segments resolve finer, shorter ones average more.
  • With a sweep or chirp as excitation, a segment must be long against the period of the lowest swept frequency and cover a good part of the sweep. Take a third to half of the sweep duration with 50 to 75 % overlap. Shorter segments make the result worse, because each one sees only a slice of the band.
  • Every component is a signal of its own with its own settings. For a Bode plot, magnitude and phase need the same segment length, overlap and frequency range. The Bode Plot preset creates both at once.

Good to know

  • NaN gaps, for example masked sections, are never bridged. Segments run only inside gap-free sections.
  • The phase is given in degrees and unwrapped.
  • For a Nyquist curve use the Nyquist Plot preset.

Transfer Function Spectrogram

Transfer function between input and output as a spectrogram H(t, f) (STFT, H1 estimator): how the frequency response changes over time, e.g. during a run-up. It carries no coherence – for one validated frequency response use Transfer Function.

Creates a new signal from: Input Signal, Output Signal. Needs a time axis.

SettingDescriptionDefault
Segment lengthLength of each STFT segment in seconds. Controls frequency vs. time resolution trade-off.0.1 s (0.001–1000)
Output ComponentMagnitude: |H(t,f)|, Magnitude dB: 20*log10(|H|), Phase: angle(H) in degrees.magnitude · magnitude_dB · phase
Start FrequencyLower frequency limit. Set to 0 to include DC.0 Hz
End FrequencyUpper frequency limit. Set to 0 for no limit (Nyquist).0 Hz

More under Advanced: Overlap, Window Function.

Reading the result

Unlike Transfer Function, this result carries no coherence. A value appears at every time and frequency, also where nothing excited the system. Check a representative steady section with Transfer Function and make sure the input covers the frequency band of interest during the whole recording.

Use it only when the frequency response changes over time. For one frequency response of the whole recording, Transfer Function is the better choice.

Good to know

Both signals are brought onto a common, evenly spaced time grid first. Samples that are missing in one of them are dropped.