obspy.signal.freqattributes.spectrum

spectrum(data, win, nfft, n1=0, n2=0)[source]

Spectrum of a signal.

Computes the spectrum of the given data which can be windowed or not. The spectrum is estimated using the modified periodogram. If n1 and n2 are not specified the periodogram of the entire sequence is returned.

The modified periodogram of the given signal is returned.

Parameters
  • data (ndarray) – Data to make spectrum of.

  • win – Window to multiply with given signal.

  • nfft – Number of points for FFT.

  • n1 (int, optional) – Starting index, defaults to 0.

  • n2 (int, optional) – Ending index, defaults to 0.

Returns

Spectrum.