fourierseries1

advertisement
KAAP686 Mathematics and Signal Processing for Biomechanics
Fourier Series 1
(Winter 3rd ed. (2005), sect. 2.5.2. Thomas’ Calculus (2003), sect. 8.9)
Many physiological signals are somewhat repetitive: they repeat (not exactly) at regular
intervals. The processing and analysis and understanding of such signals is often facilitated by
“breaking the signal down” into its “component frequencies”. What that means will now be
explained.
It turns out that any periodic signal (one that repeats itself at regular intervals) is equal to a sum
of sines and cosines. The frequencies of the component sines and cosines are just the frequency
of the original periodic signal (the fundamental frequency), plus the “overtones”, i.e. the integer
multiples of the fundamental frequency.
If the period (repeat time) of the signal is T seconds, then the frequency (in cycles/sec, or Hertz)
is f=1/T. The sines and cosines will have frequencies of f, 2f, 3f, etc. For example, if the signal
repeats every 1.25 sec, f=0.8 Hz, and the component sines and cosines have frequencies of 0.8,
1.6, 2.4 Hz, etc.
The Fourier series is the set of sines and cosines that add up to make a periodic signal. The
Fourier series for a signal x(t), which has a period of T, is
(1)
where the coefficients an and bn are given by
(2)
The coefficients an and bn are the amplitudes of the respective cosines and sines that add up to
equal the original signal x(t).
Another version of the Fourier series uses only cosines, but of varying phase angles:
(3)
where the coefficients ck and
k
are given by
,
(4)
and where the coefficients an and bn are given by eqn (2) above.
Eqns (1) through (4) are good for theoretical work, in which there is a mathematical expression
for a function x(t). But in experimental science, recorded signals are not mathematical functions
and they are only known at the times we measure them. In such cases, there is an alternative
formulation of the Fourier series the discrete Fourier series, for signals recorded by sampling
at discrete time points. For such a signal, the Fourier series is given by:
(5)
(6)
Eqn. 5 shows how the signal x(n) is made up of the sum of N complex exponentials.
(Since eiθ = cosθ + isinθ, the sum of complex exponentials really is a sum of sinusoids.)
Eqn. 6 shows how the amplitudes and phases, X(k), of the complex exponentials are determined.
Note that the above pair of eqns is almost identical. x(n) is the time domain representation of the
signal; X(k) is the frequency domain representation. The coeffs X(k) are complex numbers, with
real and imaginary parts. The real part of each X(k) corresponds to an above (i.e. the cosine
coeff), and the imaginary part of each X(k) corresponds to bn above (i.e. to the sine coeff). Eqns
(5) and (6) are called a “transform pair” since they specify how to transform from time to
frequency and back again. Eqn (5) is the Fourier synthesis it “builds up” or synthesizes the
time domain signal x(n) from the component sinusoids. It is also sometimes called the inverse
transform. Eqn (6) is the Fourier analysis it finds the frequency domain coefficients X(k) by
breaking down (analyzing) the time-domain signal x(n); it is also called simply the Fourier
transform, or the forward (as opposed to inverse) transform.
When dealing with Fourier transform of discrete signals, one must take care to be clear about
frequencies. Frequencies may be referred to by their integer index the “k” in eqns above
which has values 0, 1, 2, etc. Alternatively, the frequencies may be referred to by their actual
value in cycles per second (or Hertz). (This is only possible if the sampling interval, t, is
known.) The conversion between frequency index k and the actual frequency in Hertz is given by
,
(7)
where t is the sampling interval (time between samples) in seconds, and Nt=T, the repeat
period in seconds.
Since k take on integer values, it follows from eqn (7) that the “spacing” between frequencies in
the discrete Fourier transform is
(8)
The highest (nonredundant) frequency in the Fourier transform of a real discrete signal is
,
(9)
which corresponds to
.
(10)
There are higher frequency components in the discrete transform (from k=(N/2)+1 to k=N-1),
but they are redundant in the sense that they do not contain “new” information about the signal:
they have the same amplitudes as, and exactly opposite phases to, the components with indices
k=(N/2)-1 to k=1, respectively. (In other words, X(k=N-1) is the complex conjugate of X(k=1),
X(k=N-2) is the complex conjugate of X(k=2), etc.)
(When I say k=1, k=2, etc., I am assuming k=0 is the lowest element. Matlab arrays always
have 1, not 0, as the lowest array index, so be careful to make the necessary adjustments when
converting these ideas to Matlab.)
For some examples see fft_test1.m , fft_test1a.m, and fft_test2.m in ../reserve/matlab directory of
course web site. fft_test.m shows transform up to the Nyquist frequency (k=N/2, i.e. f=5 Hz)),
while fft_test1a.m shows transform up to k=N-1 (i.e. f=10 Hz). Note that the magnitudes are the
same and the phases are opposite when comparing frequencies 5 to 10 Hz with frequencies 5 to 0
Hz. This is why Nyquist frequency (5 Hz in this example) is also sometimes called the folding
frequency.
See also: dft_examples1.
Mean frequency and median frequency are sometimes used to summarize, in a statistical sense,
the frequency content of a signal. These quantities are defined exactly as median and mean are
usually defined in statistics. Specifics are provided in class. An example, from the
biomechanics literature, of the use of these quantities is found in Voloshin et al., Clin. Biomech.
13:515-520, 1998.
Copyright © 2013 W.C. Rose
Download