syncopy.specest.wavelet.wavelet¶
-
syncopy.specest.wavelet.
wavelet
(trl_dat, preselect, postselect, padbegin, padend, samplerate=None, toi=None, scales=None, timeAxis=0, wav=None, polyremoval=None, output_fmt='pow', noCompute=False, chunkShape=None)[source]¶ Perform time-frequency analysis on multi-channel time series data using a wavelet transform
- Parameters
trl_dat (2D
numpy.ndarray
) – Uniformly sampled multi-channel time-seriespreselect (slice) – Begin- to end-samples to perform analysis on (trim data to interval). See Notes for details.
postselect (list of slices or list of 1D NumPy arrays) – Actual time-points of interest within interval defined by preselect See Notes for details.
padbegin (int) – Number of samples to pre-pend to trl_dat
padend (int) – Number of samples to append to trl_dat
samplerate (float) – Samplerate of trl_dat in Hz
toi (1D
numpy.ndarray
or str) – Either time-points to center wavelets on if toi is anumpy.ndarray
, or “all” to center wavelets on all samples in trl_dat. Please refer tofreqanalysis()
for further details. Note: The value of toi has to agree with provided padding values. See Notes for more information.scales (1D
numpy.ndarray
) – Set of scales to use in wavelet transform.timeAxis (int) – Index of running time axis in trl_dat (0 or 1)
wav (callable) – Wavelet function to use, one of
availableWavelets
polyremoval (int) – FIXME: Not implemented yet Order of polynomial used for de-trending. A value of 0 corresponds to subtracting the mean (“de-meaning”),
polyremoval = 1
removes linear trends (subtracting the least squares fit of a linear function),polyremoval = N
for N > 1 subtracts a polynomial of order N (N = 2
quadratic,N = 3
cubic etc.). If polyremoval is None, no de-trending is performed.output_fmt (str) – Output of spectral estimation; one of
availableOutputs
noCompute (bool) – Preprocessing flag. If True, do not perform actual calculation but instead return expected shape and
numpy.dtype
of output array.chunkShape (None or tuple) – If not None, represents shape of output object spec (respecting provided values of scales, preselect, postselect etc.)
- Returns
spec – Complex or real time-frequency representation of (padded) input data.
- Return type
Notes
This method is intended to be used as
computeFunction()
inside aComputationalRoutine
. Thus, input parameters are presumed to be forwarded from a parent metafunction. Consequently, this function does not perform any error checking and operates under the assumption that all inputs have been externally validated and cross-checked.For wavelets, data concatenation is performed by first trimming trl_dat to an interval of interest (via preselect), then performing the actual wavelet transform, and subsequently extracting the actually wanted time-points (via postselect).
See also
syncopy.freqanalysis()
parent metafunction
WaveletTransform()
ComputationalRoutine
instance that calls this method ascomputeFunction()