HILBERT Function
Standard Library function that constructs a Hilbert transformation matrix.
Usage
result = HILBERT(x[, d])
Input Parameters
x—The vector to be transformed. Can be of either floating-point or complex data type, and can contain any number of elements.
d—(optional) A flag to indicate the direction of rotation:
+1 Shifts the vector +90 degrees.
–1 Shifts the vector –90 degrees.
Returned Value
result—The value of the Hilbert transform of x. Result is of a complex data type, with the same dimensions as x.
Keywords
None.
Discussion
Hilbert transform is a series of numbers in which all periodic components have been phase-shifted by 90 degrees. Angle shifting is accomplished by multiplying or dividing by the complex number i = (0.000, 1.000).
A Hilbert series has the interesting property that the correlation between it and its own Hilbert transform is mathematically zero.
The HILBERT function generates a Hilbert matrix by generating the Fast Fourier Transform of the data with the FFT function and shifting the first half of the transform products by +90 degrees and the second half by –90 degrees. The constant elements of the transform are not changed.
The shifted vector is then submitted to the FFT function for the transformation back to the “time” domain. Before it is returned, the output is divided by the number of elements in the vector to correct for the multiplication effect characteristic of the FFT algorithm.
Example
; Create and plot a sine wave.
a = FINDGEN(1000)
sine_wave = SIN(a/(MAX(a)/(2 * !Pi)))
TEK_COLOR
; Plot the sine wave phase-shifted to the right by 90 degrees.
PLOT, sine_wave
; Create and plot array of random numbers to mimic noisy signal.
OPLOT, HILBERT(sine_wave, -1), Color=WoColorConvert(4)
WAIT, 1
rand = RANDOMN(seed, 1000) * 0.05
PLOT, rand, Title='Random Data'
WAIT, 1
; Sandwich the random data between two sine waves.
sandwich = [sine_wave, rand, sine_wave]
; Plot two sine waves with the random noise in the middle,
; thereby turning them into a single signal.
PLOT, sandwich, XStyle=1
; Plot sandwiched wave forms. Note that sine waves are phase-
; shifted to right by 90 degrees, while noise data has not shifted
; at all, but has been distorted vertically (its amplitude) by
; the effect of two adjacent phase-shifted sine waves. This is
; because sine waves and noise data were set up to be a single
; signal.
OPLOT, HILBERT(sandwich, -1), Color=WoColorConvert(6)
See Also