spectrogram

function of dascore.transform.spectro source

spectrogram(
    patch: Patch ,
    dim: str = time,
    **kwargs ,
)-> ‘PatchType’

Calculate a spectrogram from the patch data.

The output patch will have one more dimensions than the input patch.

Parameters

Parameter Description
patch The input patch
dim The dimension along which the spectrograms are calculated.
**kwargs Passed to scipy.signal.spectrogram to control spectrogram options.
See its documentation for options.

Examples

import dascore as dc
patch = dc.get_example_patch()
# calculate spectrogram along time axis
time_spec = patch.spectrogram("time")
# note the new dimensions
print(time_spec.dims)
# perform fourier transforms along distance dimensions
dist_spec = patch.spectrogram("distance")
('distance', 'ft_time', 'time')