Signal Processing Toolbox |
Discrete-time analytic signal using Hilbert transform
Syntax
Description
x
returns a complex helical sequence, sometimes called the analytic signal, from a real data sequence. The analytic signal =
hilbert(xr)
x
= xr
+ i*xi
has a real part, xr
, which is the original data, and an imaginary part, xi
, 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 xr
is a matrix, x = hilbert(xr)
operates columnwise on the matrix, finding the Hilbert transform of each column.
x
uses an =
hilbert(xr,n)
n
point FFT to compute the Hilbert transform. The input data xr
is zero-padded or truncated to length n
, as appropriate.
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 spectral density of a time series. The toolbox function rceps
performs this reconstruction.
For a discrete-time analytic signal x
, the last half of fft(x)
is zero, and the first (DC) and center (Nyquist) elements of fft(x)
are purely real.
Examples
You can see that the imaginary part, imag(x)
= [1 -1 -1 1]
, is the Hilbert transform of xr
, and the real part, real(x)
= [1 2 3 4]
, is simply xr
itself. Note that the last half of fft(x)
= [10 -4+4i -2 0]
is zero (in this example, the last half is just the last element), and that the DC and Nyquist elements of fft(x)
, 10 and -2 respectively, are purely real.
Algorithm
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:
x
.
h
whose elements h(i)
have the values:
x
and h
.
n
elements of the result.
If the input data xr
is a matrix, hilbert
operates in a similar manner, extending each step above to handle the matrix case.
See Also
References
[1] Claerbout, J.F., Fundamentals of Geophysical Data Processing, McGraw-Hill, 1976, pp. 59-62.
[2] Marple, S.L., "Computing the discrete-time analytic signal via FFT," IEEE Transactions on Signal Processing, Vol. 47, No. 9 (September 1999), pp. 2600-2603.
[3] Oppenheim, A.V., and R.W. Schafer, Discrete-Time Signal Processing, 2nd ed., Prentice-Hall, 1998.
hann | icceps |
© 1994-2005 The MathWorks, Inc.