Signal Processing Toolbox | Help Desk |
hilbert
Hilbert transform.
y = hilbert(x)
y = hilbert(x)
returns a complex helical sequence, sometimes called the analytic signal, from a real data sequence. The analytic signal has a real part, which is the original data, and an imaginary part, which contains the Hilbert transform. The imaginary part is a version of the original real sequence with a 90° phase shift. Sines are therefore transformed to cosines and vice versa. The Hilbert transformed series has the same amplitude and frequency content as the original real data and includes phase information that depends on the phase of the original data.
If x
is a matrix, y = hilbert(x)
operates columnwise on the matrix, finding the Hilbert transform of each column.
The Hilbert transform is useful in calculating instantaneous attributes of a time series, especially the amplitude and frequency. The instantaneous amplitude is the amplitude of the complex Hilbert transform; the instantaneous frequency is the time rate of change of the instantaneous phase angle. For a pure sinusoid, the instantaneous amplitude and frequency are constant. The instantaneous phase, however, is a sawtooth, reflecting the way in which the local phase angle varies linearly over a single cycle. For mixtures of sinusoids, the attributes are short term, or local, averages spanning no more than two or three points.
Reference [1] describes the Kolmogorov method for minimum phase reconstruction, which involves taking the Hilbert transform of the logarithm of the spectrum of a time series. The toolbox function rceps
performs this reconstruction.
The analytic signal for a sequence x
has a one-sided Fourier transform, that is, negative frequencies are 0. To approximate the analytic signal, hilbert
calculates the FFT of the input sequence, replaces those FFT coefficients that correspond to negative frequencies with zeros, and calculates the inverse FFT of the result.
In detail, hilbert
uses a four-step algorithm:
y
. Before transforming, it zero pads the input sequence so its length n
is the closest power of two, if necessary. This ensures the most efficient FFT computation.
h
whose elements h(i)
have the values
y
and h
.
n
elements of the result.
x
is a matrix, hilbert
operates in a similar manner, extending each step above to handle the matrix case.