import dascore as dc
import numpy as np
= dc.get_example_patch()
patch = patch.envelope(dim="time")
env # Envelope is always positive
assert np.all(env.data >= 0)
envelope
envelope(
patch: Patch ,
dim: str ,
)-> ‘PatchType’
Calculate the envelope of a signal using the Hilbert transform.
The envelope is the magnitude of the analytic signal, which represents the instantaneous amplitude of the signal.
Parameters
Parameter | Description |
---|---|
patch | The patch to process. |
dim | The dimension along which to calculate the envelope. |
Returns
PatchType A patch containing the envelope (real-valued, positive).