hilberttrans#

torchspin.hilberttrans(y)[source]#

Compute the analytic signal (Hilbert transform) of a real 1D array.

The output is a complex array: real(out) ≡ y, imag(out) = Hilbert transform (90° phase-shifted version of y).

Useful for computing the dispersion signal from an absorption spectrum.

Parameters:

y (array-like) – Real-valued 1D input vector.

Returns:

y_h (ndarray (complex), same length as *y.*)

Return type:

np.ndarray

Examples

>>> x = np.linspace(-3, 3, 512)
>>> yabs  = np.exp(-x**2)
>>> y_h   = hilberttrans(yabs)
>>> ydisp = np.imag(y_h)