braintools.analysis.spectral.analytic_signal#
- braintools.analysis.spectral.analytic_signal(x, axis=0)#
Compute the analytic signal by the FFT Hilbert transform.
The analytic signal is \(x_a = x + i\,\mathcal{H}[x]\) [1]. It is obtained by zeroing the negative-frequency half of the spectrum and doubling the positive half (DC and, for even length, the Nyquist bin are kept as is), exactly as
scipy.signal.hilbert.- Parameters:
- Returns:
xa – Complex analytic signal of the same shape (and unit) as
x;abs(xa)is the amplitude envelope andangle(xa)the instantaneous phase.- Return type:
Array|Quantity- Raises:
ValueError – If
xis complex or the transform axis has length 0.
See also
Notes
The function is jittable, vmappable and (being linear) differentiable with respect to
x.References
Examples
>>> import jax.numpy as jnp >>> from braintools.analysis.spectral import analytic_signal >>> t = jnp.arange(1000) * 1e-3 >>> z = analytic_signal(jnp.cos(2 * jnp.pi * 10 * t)) >>> bool(jnp.allclose(jnp.abs(z), 1.0, atol=1e-4)) True