pyrfu.pyrf.wavelet#

pyrfu.pyrf.wavelet(inp: DataArray, f_s: float | None = None, f: list[float] | None = None, n_freqs: int | None = None, linear: float | bool | None = None, wavelet_width: float | None = None, cut_edge: bool | None = True, return_power: bool | None = True) → DataArray | Dataset[source]#

Computes wavelet spectrogram based on fast FFT algorithm.

Parameters:
  • inp (DataArray) – Input quantity.

  • f_s (float, Optional) – Sampling frequency of the input time series.

  • f (list, Optional) – Vector [f_min f_max], calculate spectra between frequencies f_min and f_max.

  • n_freqs (int, Optional) – Number of frequency bins.

  • linear (float or bool, Optional) – Linear spacing between frequencies of df: the frequencies are df, 2 df, … up to the highest frequency of f (the Nyquist frequency if f is not given); the lowest frequency of f is not used. True uses df = 100 Hz, as irf_wavelet.

  • wavelet_width (float, Optional) – Width of the Morlet wavelet. Default 5.36.

  • cut_edge (bool, Optional) – Set to True to set points affected by edge effects to NaN, False to keep edge affect points. Default True

  • return_power (bool, Optional) – Set to True to return the power, False for complex wavelet transform. Default True.

Returns:

Wavelet transform of the input.

Return type:

DataArray or Dataset

Raises:
  • TypeError – If linear keyword argument is not bool or float.

  • ValueError – If input is not 1D or 2D.