bruges.attribute.spectrogram module

Spectrogram.

copyright:2015 Agile Geoscience
license:Apache 2.0
bruges.attribute.spectrogram.spectrogram(data, window_length, dt=1.0, window_type='boxcar', overlap=0.5, normalize=False, zero_padding=0)[source]

Calculates a spectrogram using windowed STFTs.

Parameters:
  • data – 1D numpy array to process into spectra.
  • window_length – The length of the window in seconds if dt is set, otherwise in samples. Will zero pad to the closest power of two.
Keyword Arguments:
 
  • window_type – A string specifying the type of window to use for the STFT. The same input as scipy.signal.get_window
  • dt – The time sample interval of the trace. Defaults to 1, which allows window_length to be in seconds.
  • overlap – The fractional overlap for each window. A value of 0 uses no redudant data, a value of 1 slides the STFT window one sample at a time. Defaults to 0.5
  • normalize – Normalizes the each spectral slice to have unity energy.
  • zero_padding – The amount of zero padding to when creating the spectra.
Returns:

A spectrogram of the data ([time, freq]).

( 2D array for 1D input )

See Also

spectraldecomp : Spectral decomposition