comnum.psd#

comnum.psd(x, *, fs=1.0, nfft=1024)#

Welch’s power spectral density (periodic Hann window, 50 % overlap), centred.

Parameters:
  • x (array_like) – the signal.

  • fs (float) – sampling rate (Hz).

  • nfft (int) – length of a segment.

Returns:

the frequencies (Hz) and the density (power per Hz), which integrates to the average power.

Return type:

tuple[numpy.ndarray, numpy.ndarray]

Raises:

ValueError – for an invalid parameter or input (the message names it).