pygwb.spectral.power_spectral_density

pygwb.spectral.power_spectral_density(time_series_data: TimeSeries, segment_duration: int, frequency_resolution: float, coarse_grain: bool = False, zeropad: bool = False, overlap_factor: float = 0.5, window_fftgram_dict: dict = {'window_fftgram': 'hann'}, overlap_factor_welch: float = 0.5)[source]

Compute the PSDs of every segment (defined by the segment duration) in the time series using pwelch method.

Parameters:
  • time_series_data (gwpy.timeseries.TimeSeries) – Timeseries from which to compute PSDs.

  • segment_duration (int) – Data duration over which PSDs need to be calculated.

  • duration (segment) – Data duration (in seconds) over which each PSDs need to be calculated.

  • frequency_resolution (float) – Frequency resolution (in Hz) of the final PSDs. This sets the time duration over which FFTs are calculated in the pwelch method.

  • coarse_grain (bool, optional) – Coarse-graining flag; if True, PSD will be estimated via coarse-graining as opposed to Welch-averaging. Default is False.

  • zeropad (bool, optional) – Before doing FFT whether to zero pad the data equal to the length of FFT or not. Default is False.

  • overlap_factor (float, optional) – Amount of overlap between adjacent segments (range between 0 and 1). Users should provide proper combination of overlap_factor and window_fftgram_dict. For “hann” window use 0.5 overlap_factor and for “boxcar” window use 0 overlap_factor. Default is 0.5 (50% overlap)

  • window_fftgram_dict (dictionary, optional) – Dictionary containing name and parameters describing which window to use for producing FFTs. Default is “hann”.

  • overlap_factor_welch (float, optional) – Overlap factor to use when using Welch’s method (NOT coarsegraining). Users should provide proper combination of overlap_factor and window_fftgram_dict. For “hann” window use 0.5 overlap_factor and for “boxcar” window use 0 overlap_factor. Default is 0.5 (50% overlap), which is optimal when using Welch’s method with a “hann” window.

Returns:
psd_spectrogram: gwpy.spectrogram.Spectrogram

PSD spectrogram with each PSD duration equal to segment duration.