stglib.core.waves.pressure_spectra

stglib.core.waves.pressure_spectra(x, fs=1.0, window='hann', nperseg=256, **kwargs)[source]

Compute pressure spectral density using Welch’s method

Parameters:
  • x (array_like) – Time-series of pressure data

  • fs (float, optional) – Sampling frequency (Hz)

  • window (str, optional) – Window, default ‘hann’

  • nperseg (int, optional) – Length of each segment, default 256

  • **kwargs – Arbitrary keyword arguments passed to scipy.signal.welch

Returns:

  • f (ndarray) – Array of sample frequencies

  • Pxx (ndarray) – Power spectral density of pressure data