import dascore as dc
import numpy as np
patch = dc.get_example_patch()
env = patch.envelope(dim="time")
# 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).