hilbert2#

class diffsptk.TwoDimensionalHilbertTransform(fft_length, dim=(-2, -1))[source]#

2-D Hilbert transform module.

Parameters:
fft_lengthint or list[int]

Number of FFT bins.

dimlist[int]

Dimensions along which to take the Hilbert transform.

forward(x)[source]#

Compute analytic signal using the Hilbert transform.

Parameters:
xTensor [shape=(…, T1, T2, …)]

Input signal.

Returns:
outTensor [shape=(…, T1, T2, …)]

Analytic signal, where real part is the input signal and imaginary part is the Hilbert transform of the input signal.

Examples

>>> x = diffsptk.nrand(3)
>>> x
tensor([[ 1.1809, -0.2834, -0.4169,  0.3883]])
>>> hilbert2 = diffsptk.TwoDimensionalHilbertTransform((1, 4))
>>> z = hilbert2(x)
>>> z.real
tensor([[ 1.1809, -0.2834, -0.4169,  0.3883]])
>>> z.imag
tensor([[ 0.3358,  0.7989, -0.3358, -0.7989]])
diffsptk.functional.hilbert2(x, fft_length=None, dim=(-2, -1))[source]#

Compute analytic signal using the Hilbert transform.

Parameters:
xTensor [shape=(…, T1, T2, …)]

Input signal.

fft_lengthint, list[int], or None

Number of FFT bins. If None, set to (\(T1\), \(T2\)).

dimlist[int]

Dimensions along which to take the Hilbert transform.

Returns:
outTensor [shape=(…, T1, T2, …)]

Analytic signal, where real part is the input signal and imaginary part is the Hilbert transform of the input signal.

See also

hilbert