xdas.signal.hilbert#
- xdas.signal.hilbert(da, N=None, dim='last', parallel=None)[source]#
Compute the analytic signal, using the Hilbert transform.
The transformation is done along the last axis by default.
- Parameters:
da (DataArray) – Signal data. Must be real.
N (int, optional) – Number of Fourier components. Default: da.sizes[dim].
dim (str, optional) – The dimension along which to transform. Default: last.
parallel (bool or int, optional) – Number of threads to use. True uses all cores, False uses one, an int uses that many, None defers to the global xdas configuration. Default is None.
- Returns:
Analytic signal of da along dim.
- Return type:
Notes
Splits on data discontinuities along dim.
Examples
In this example we use the Hilbert transform to determine the analytic signal.
>>> import xdas.signal as xs >>> from xdas.synthetics import wavelet_wavefronts
>>> da = wavelet_wavefronts() >>> xs.hilbert(da, dim="time") <xdas.DataArray (time: 300, distance: 401)> [[ 0.0497+0.1632j -0.0635+0.0125j ... 0.1352-0.3107j -0.2832-0.0126j] [-0.1096-0.0335j 0.124 +0.0257j ... -0.0444+0.2409j 0.1378-0.2702j] ... [-0.1977+0.0545j -0.0533-0.1947j ... 0.3722+0.125j -0.0127+0.1723j] [ 0.1221-0.1808j 0.1888+0.0368j ... -0.4517+0.1581j 0.0411+0.1512j]] Coordinates: * time (time): 2023-01-01T00:00:00.000 to 2023-01-01T00:00:05.980 * distance (distance): 0.000 to 10000.000