FREQUENCY REPRESENTATION OF BIODATA
We have described the time resolution of biodata in detail during the first section of the course, in which basic quantification methods were discussed. Often the data is preprocessed in the frequency domain. There are at lest two main reasons for sinusoidal frequency (Fourier) filtering and analysis of biodata:
1. recognition - the data may be more recognizable by computer algorithm based on the pattern of frequency components that is extracted and those that remain.
2. filtering - noise in the data that is periodic can be removed by computing the Fourier transform, removing those harmonics, as much as possible, consisting of the noise space, and reconstructing the image with the remaining harmonics.
Sinusoidal bases
The Fourier transform is used to construct a sinusoidal basis, which is a series of sinusoidal functions used to represent a signal or image of the form:
Hi = A sin (
w t +j ) + B
where H is the harmonic, i is the harmonic number, A is the gain factor,
w is the frequency, t is the time (discrete time is usually represented as k or n), f is the phase shift, and B is the DC bias, and:
w
= 2 p f
where f is the frequency in Hertz of cycles per second. The fundamental, or first harmonic, has the same period as the longest periodicity of the signal or image itself. Higher harmonics, from 2nd, to 3rd, to 4th, and so on, are simply integer multiples of the 1st harmonic in terms of their periods. Therefore, higher harmonics have greater frequencies, since the frequency f in cycles per second (Hertz) is the inverse of the time period T in seconds.
The Fourier series is that set of harmonics that are used to represent a particular signal or image, including the parameters of amplitude and phase lag for each of the harmonics. The accuracy of the representation depends on the character of the signal or image. If for example a square wave is to be represented with a series of sinusoids, many harmonics will be needed for accurate representation. Whereas, a blood pressure pulse signal, which has a tendency to possess few sharp edges in normal persons, requires only a few harmonics (perhaps 7) for accurate representation. 'Accuracy' of representation can be measured in a number of ways. A common method is to take the difference between the original signal or image and that reconstructed with a predefined number of Fourier harmonics. For example, say that 7 harmonics are used to represent a particular blood pressure signal. To form the Fourier reconstructed signal we simply add the harmonic signals together after first scaling and shifting them using the values of the amplitude and phase lag parameters, respectively. We then subtract, digitized point by digitized point, the Fourier reconstructed signal from the original blood pressure signal. The resulting set of m difference values is known as the error vector e, where:
The phasor model
The phasor model can be used to describe biodata in terms of the real and imaginary components. A phasor consists of the following parameters: A - magnitude,
q - angle, and w - radial speed. The tip of the phasor at any given time can be described in terms of the Cartesian coordinates:
x(t) = a + j b
where x(t) is the signal, a is the real component, and j is the imaginary component. Therefore, the magnitude is:
A =
Ö (a2 + b2)
and:
q
= w t = tan-1 (b/a)
We can also describe the signal using the polar form:
x(t) = A e
jwt
where:
e
jwt = cos(w t) + j sin(w t)
and as before:
w
= 2 p f
The Fourier series
The Fourier series is a method to describe a signal that assumes that a set of phasors are a multiple of some fundamental frequency
w 0:x(t) =
S Ck e j(wo k t) from k = -N to N
where k is the phasor number and t is a continuous variable. The discrete Fourier series is given as:
x(n) =
S Ck e j(wo k Ts n) from k = -N to N
where n is the discrete time unit and Ts is the period of the signal. Since most signals are not periodic, the Fourier series should be modified by taking the integral rather than the summation, which is called the Fourier transformation:
x(n) = (1/2
p) ò x(w) e j(w Ts n) d(wTs) from -p to p
where
x(w) is the Fourier coefficient and the limits can be taken from -p to p because the sinusoidal basis is periodic and repeats itself every 2p. The reverse transform is:X(
w) = S x(n) ej(-wo k Ts n)
The reverse transform still uses a discrete summation because x(n) is only valid at nTs instants in time. In the real world an infinite summation is not possible, so practically speaking we should window the Fourier transform:
XN(
w) = X(w)* W(w)
Where W(
wo) is the window function taken over N sample points, and * is the convolution operator, i.e.:
XN(
w) = S X(r) * W(N - r) for r = 0 to N - 1
The Discrete Fourier Transform (DFT)
Consider that the phasors are spaced at discrete intervals
d , so that:N
d = w s
Then we can write:
XN
(k) = S x(n) e-j(2p k n / N) from n = 0 to N - 1
We can define a 'twiddle factor':
W
N = e-j(2p / N)
So that the DFT pair can be written:
X
N(k) = S x(n) WN kn
X
(n) = (1/N) S XN(k) WN-kn
The Fast Fourier transform (FFT)
The Fast Fourier transform (FFT) makes use of the fact that the twiddle factor is a periodic function with a limited number of discrete values. These values are such that it is possible to replace multiplication with addition and subtraction arithmetic functions in many of the calculations. This can greatly decrease the time required for digital computer processing.
Plotting data in the frequency domain
The frequency space for 1 dimensional signals is often plotted as two graphs: one for magnitude, or amplitude, of each harmonic and one for the phase shift or lag. The independent variable (X-axis) for each of these graphs is the Fourier harmonic number. Generally but not always, the magnitude of the Fourier harmonic used for reconstruction of a signal decreases with increased harmonic number. (For very complex and sharp signals, however, this is not necessarily true). In contrast, he phase lag of each harmonic is not usually dependent on harmonic number. For images, we typically plot the Fourier magnitude on a square the size of the image. The location and orientation of a given Fourier harmonic is marked by a pair of points which are symmetric about the center of the Fourier space. A line formed by the pair of points gives the orientation of the Fourier harmonic with respect to the image, and the brightness (or color) of the points denotes the magnitude, or amplitude, of the Fourier harmonic.
Consider for example an image that consists of a sinusoidally changing brightness level with a fixed orientation. As the period of the sinusoid decreases, the frequency increases, i.e., the representation by a pair of points in Fourier space will be such that the points are shifted farther apart. As the period of the sinusoid increases, the frequency decreases, i.e., the representation by a pair of points in Fourier space will be such that the points are shifted closer together. In the limit as the period of the sinusoid becomes very long and approaches the DC (average) level, the pair of points converge upon the center of the Fourier space (i.e. the location where the DC level is represented). If there are two or more sinusoidally changing patterns of brightness in the image, it will be represented by the corresponding numbers of Fourier pairs in the Frequency space. The location and brightness level of each pair corresponds to that of the patterns in the image.
More complex image shapes can also be represented in Fourier space. For example, a step function, or square pattern in the image, can be represented. Just as for square-wave signals, many Fourier harmonics are needed for accurate representation of a step or square in the original image. Similarly, patterns such as letters of the alphabet, faces, or cells can be represented in Fourier space. Since these patterns however, like a step or square in an image, are not periodic, many Fourier components will be needed to represent them to a good level of accuracy (i.e., harmonics throughout the Fourier space will be needed).
Ó 2004 EJ Ciaccio, all rights reserved.