# Fast Hilbert Transform (G Dataflow)

Computes the fast Hilbert transform of a sequence.

## reset

A Boolean that specifies whether to reset the internal state of the node.

 True Resets the internal state of the node. False Does not reset the internal state of the node.

This input is available only if you wire a double-precision, floating-point number to x.

Default: False

## x

Input signal.

This input accepts a double-precision, floating-point number or a 1D array of double-precision, floating-point numbers.

## sample length

Length of each set of data. The node performs computation for each set of data.

sample length must be greater than zero.

This input is available only if you wire a double-precision, floating-point number to x.

Default: 100

## error in

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Default: No error

## Hilbert{x}

The fast Hilbert transform of the input sequence.

## error out

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

## Algorithm for Computing the Fast Hilbert Transform

The Hilbert transform of a function x(t) is defined as

$h\left(t\right)=H\left\{x\left(t\right)\right\}=\frac{1}{\pi }{\int }_{-\infty }^{\infty }\frac{x\left(\tau \right)}{t-\tau }d\tau$

Using Fourier identities, you can show the Fourier transform of the Hilbert transform of x(t) is

$h\left(t\right)⇔H\left(f\right)=-j\mathrm{sgn}\left(f\right)X\left(f\right)$

where $x\left(t\right)⇔X\left(f\right)$ is a Fourier transform pair and

$\mathrm{sgn}\left(f\right)=\left\{\begin{array}{c}\begin{array}{cc}1& f>0\end{array}\\ \begin{array}{c}\begin{array}{cc}0& f=0\end{array}\\ \begin{array}{cc}\begin{array}{c}-1\end{array}& f<0\end{array}\end{array}\end{array}$
.

## Performing the Discrete Implementation of the Hilbert Transform

This node performs the discrete implementation of the Hilbert transform with the aid of the FFT routines based upon the $h\left(t\right)⇔H\left(f\right)$ Fourier transform pair by taking the following steps:

1. Fourier transform the input sequence X.
Y = F{X}

2. Set the DC component to zero.
Y0 = 0.0

3. If the sequence Y is an even size, set the Nyquist component to zero.
YNyq = 0

4. Multiply the positive harmonics by -j.
5. Multiply the negative harmonics by j. Call the new sequence H, which is of the formHk = -jsgn(k)Yk
6. Inverse Fourier transform H to obtain the Hilbert transform of the input sequence.

The output sequence Y = Inverse FFT [X] is complex and it is returned in one complex array: Y = (Yre,Yim).

Note

Because this node sets the DC and Nyquist components to zero when the number of elements in the input sequence is even, you cannot always recover the original signal with an inverse Hilbert transform. The Hilbert transform works well with bandpass limited signals, which exclude the DC and the Nyquist components.

## Applications of Hilbert Transform

You can use the Hilbert transform to accomplish the following tasks:

• Extract instantaneous phase information and obtain the single-sideband spectra
• Obtain the envelope of an oscillating signal
• Detect echoes
• Reduce sampling rates

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported

Web Server: Not supported in VIs that run in a web application