NSPCH 4
NSPCH 4
.
4.2 Least square fit of Sinusoid
Eqn. (6) can be written as a linear least squares model
0 1 0 1 0
cos( ) sin( ) y A A t B t = + + (11)
The sum of the squares of the residuals for this model can be written as
| | { }
0 1 0 1 0
1
cos( ) sin( )
2
=
= + +
N
r i i i
i
S y A A t B t
This quantity can be minimized by taking its partial derivatives w.r.t each of the coefficients and
setting the resulting equations which can be expressed in matrix form as
(12)
These equations can be employed to solve for the unknown coefficients. Consider a case with N
observations equispaced at intervals of t and with a total record length of T = (N 1) t. For
this situation, the following average values can be determined.
2
0
sin ( )
1
2
t
N
2
0
cos ( )
1
2
=
t
N
0 0
cos( )sin( )
0
t t
N
=
(13)
Thus, for equispaced points the normal equations become
0
1 0
1 0
0 0
0 2 0 cos( )
0 0 2 sin( )
| |
|
=
` `
|
|
\ . )
)
N A y
N A y t
N B y t
The coefficients A
0
, A
1
, and B
1
can be obtained by matrix inversion
0
1 0
1 0
1
0 0
0 2 0 cos( )
0 0 2 sin( )
| |
|
|
=
` ` |
|
)
)
|
\ .
A y
N
A N y t
B N y t
or
0
y
A
N
=
(14)
1 0
2
cos( ) A y t
N
=
(15)
1 0
2
sin( ) B y t
N
=
(16)
Example 4.1. Least square fit of a sinusoid
A curve is described by y = 1.7 + cos (4.189t + 1.0472). Generate 10
discrete values for this curve at intervals of t = 0.15 for the range t = 0 to 1.35.
Use this information to evaluate the coefficients of Eqn (11) by least squares fit.
Solution: The data required to evaluate the coefficients are
t
y
0
cos( ) y t
0
sin( ) y t
0
0.15
0.30
0.45
0.60
0.75
0.90
1.05
1.20
1.35
2.200
1.595
1.031
0.722
0.786
1.200
1.805
2.369
2.678
2.614
2.200
1.291
0.319
-0.223
-0.636
-1.200
-1.460
-0.732
0.829
2.114
0.000
0.938
0.980
0.687
0.462
0.000
-1.061
-2.253
-2.547
-1.536
=
17.000 2.502 -4.330
These results can be used to determine [Eqn (14) to Eqn (16)]
0
17.000
1.7
10
A = =
1
2
(2.502) 0.5
10
A = =
1
2
( 4.330) 0.866
10
B = =
Thus, the least-squares fit is
0 0
1.7 0.50cos( ) 0.866sin( ) y t t = +
The model can also be expressed in the format of Eqn (2) by calculating [Eqn (8)]
1
0.866
tan ( ) 1.0472
0.500
= =
And Eqn. (9)
2 2
1
(0.5) ( 0.866) 1.00 C = + =
to give
0
1.7 cos( 1.0472) y t = + +
Or alternatively as a sine by using Eqn. (10)
0
1.7 sin( 2.618) y t = + +
Extending the analysis discussed in the above section to the general model
0 1 0 1 0 2 0
2 0 0 0
( ) cos( ) sin( ) cos(2 )
sin(2 ) .... cos( ) sin( )
m m
y t A A t B t A t
B t A m t B m t
= + + +
+ + + +
For equally spaced data, the coefficients can be evaluated by
0
y
A
N
=
0
2
cos( )
j
A y j t
N
=
0
2
sin( )
j
B y j t
N
=
j= 1, 2, 3,.m.
The above relationships can be used to fit data in the regression sense (i.e., N>2m+1).
Alternatively they can be employed for interpolation or collocation, (i.e.,) to use them for the
case where number of unknowns, 2m+1, is equal to the number of data points, N. This approach
is used in the continuous Fourier series.
4.3 Continuous Fourier series
In the course of studying heat flow problems, Fourier showed that an arbitrary periodic function
can be represented by an infinite series of sinusoids of harmonically related frequencies. For a
function with period T, a continuous Fourier series can be written as
| |
0 0 0
1
( ) cos( ) sin( )
=
= + +
k k
k
f t a a k t b k t (17)
Where
0
2
T
= < <
< <
Fig.3. A square or rectangular wave form with a height of 2 and a period
0
2 / T =
Solution: Because the average height of the wave is zero, a value of a
0
=0 can be obtained
directly. The remaining coeffiecients can be evaluated as Eqn. (18)
/ 2
0
/ 2
2
( ) cos( )
T
T
k
T
a f t k t dt
=
=
/ 4 / 4 / 2
0 0 0
/ 2 / 4 / 4
2
cos( ) cos( ) cos( )
T
(
+
(
T T T
T T T
k t dt k t dt k t dt
The integrals can be evaluated to give
4/ for 1, 5, 9,....
4/ for 3, 7,11,....
0 for even integers
=
= =
k
k k
a k k
k
Similarly, it can be determined that all the bs = 0. Therefore, the Fourier series approximation is
0 0 0 0
4 4 4 4
( ) cos( ) cos(3 ) cos(5 ) cos(7 ) .....
3 5 7
f t t t t t
= + +
The results up to the first three terms are shown in Fig. 4.
Fig. 4.
The Fourier series approximation of the
square wave from Fig. 3. The series of plots
shows the summation up to and including
the (a) first, (b) second, (c) third terms. The
individual terms that were added at each
stage are also shown.
RESPONSE UNDER A GENERAL
PERIODIC FORCE
When the external force F(t) is periodic with period / 2 =
it can be expanded in a Fourier series
) 1 ( sin cos ) (
1 1
0
=
=
+ + =
j
j
j
j
t j b t j a a t F
where
) 3 ( ,........ 2 , 1 , cos ) (
2
0
= =
j dt t j t F a
j
) 2 ( , ) (
1
0
0
=
dt t F a
and
) 4 ( ,........ 2 , 1 , sin ) (
2
0
= =
j dt t j t F b
j
=
+ + = = + +
The right-hand side of this equation is a constant
plus a sum of harmonic functions. Using the
principle of superposition, the steadystate solution
of Eq. (5) is the sum of the steadystate solutions of
the following equations:
) 8 ( sin
) 7 ( cos
) 6 (
. ..
. ..
0
. ..
t j b kx x c x m
t j a kx x c x m
a kx x c x m
j
j
= + +
= + +
= + +
Noting that the solution of Eq.5 is given by
) 9 ( ) (
0
k
a
t x
p
=
and we can express the solution of Eqs.(7) and (8)
respectively, as
( )
( ) ) 10 ( cos
) 2 ( ) 1 (
/
) (
2 2 2 2
j
j
p
t j
jr r j
k a
t x
+
=
( )
( )
( ) ) 11 ( sin
) 2 ( 1
/
) (
2
2
2 2
j
j
p
t j
jr r j
k b
t x
+
=
where
) 12 (
1
2
tan
2 2
1
|
|
.
|
\
|
=
r j
jr
j
and
) 13 (
n
r
=
Thus the complete steady state solution of Eq. (5)
is given by
( )
( )
( )
( ) ) 14 ( sin
) 2 ( ) 1 (
/
cos
) 2 ( ) 1 (
/
) (
1
2 2 2 2
1
2 2 2 2
0
+
+
+
+ =
j
j
j
j
j
j
p
t j
jr r j
k b
t j
jr r j
k a
k
a
t x
= = =
and p(t) is the pressure acting on the valve at any
instant t. Since p(t) is periodic
2 =
a constant, F(t) is also a periodic function of
period seconds. The frequency of the forcing
function is F(t) can be expressed
in a Fourier series as
seconds and A is
2 =
. / ) / 2 ( s rad = =
) 3 . ( . .......... 2 sin sin
. .......... 2 cos cos ) (
2 1
2 1 0
E t b t b
t a t a a t F
+ + +
+ + + =
where a
j
and b
j
are given by Eqs. (3) and (4). Since
the function F(t) is given by
( )
) 4 . (
2
2 000 50
2
0 000 50
) ( E
t for t A
t for t A
t F
+ =
) 6 . (
10 2
cos ) 2 ( 000 50 cos 000 50
2
2
2
5
1
0
2
1
1
E
A
dt t t A dt t At a
=
(
+ =
) 9 . ( 0 2 sin ) 2 ( 000 50 2 sin 000 50
2
2
) 8 . ( 0 2 cos ) 2 ( 000 50 2 cos 000 50
2
2
) 7 . ( 0 sin ) 2 ( 000 50 sin 000 50
2
2
1
0
2
1
2
1
0
2
1
2
1
0
2
1
1
E dt t t A dt t At b
E dt t t A dt t At a
E dt t t A dt t At b
=
(
+ =
=
(
+ =
=
(
+ =
) 10 . (
9
10 2
3 cos ) 2 ( 000 50 3 cos 000 50
2
2
2
5
1
0
2
1
3
E
A
dt t t A dt t At a
=
(
+ =
) 11 . ( 0 3 sin ) 2 ( 000 50 3 sin 000 50
2
2
1
0
2
1
3
E dt t t A dt t At b =
(
+ =
Likewise, we can obtain a
4
= a
6 ..
= b
4
= b
5
= b
6
= = 0.
By considering only the first three harmonics, the
forcing function can be approximated:
) 12 . ( 3 cos
9
10 2
cos
10 2
000 25 ) (
2
5
2
5
E t
A
t
A
A t F
Response Under a Periodic Force of Irregular
Form
In some cases, the force acting on a system may be
quite irregular and may be determined only
experimentally. Examples of such forces include wind
and earth quake induced forces. In such cases, the
forces will be available in graphical form and no
analytical expression can be found to describe F(t).
Sometimes, the value of F(t) may be available only at
a number of discrete points t
1
, t
2
, .., t
N
. In all these
cases, it is possible to find the Fourier coefficients by
using a numerical integration procedure.
If F
1
, F
2
, ,F
N
denote the values of F(t) at , t
1
,
t
2
, .., t
N
respectively, where N denotes an even
number of equidistant points in one time period
as shown in Fig.2, the application of
trapezoidal rule gives
), ( t N =
) 1 (
1
1
0
=
=
N
i
i
F
N
a
) 2 ( ....... ,......... 2 , 1 ,
2
cos
2
1
= =
=
j
t j
F
N
a
i
N
i
i j
) 3 ( ....... ,......... 2 , 1 ,
2
sin
2
1
= =
=
j
t j
F
N
b
i
N
i
i j
\
|
=
n
r
= =
= = = =
12
1 1
0
) 1 . ( 3 . 34083
12
000 409
12
1 1
i
i
N
i
i
E p p
N
a
= =
= =
12
1 1
) 2 . (
12 . 0
2
cos
6
1 2
cos
2
i
i
i
i
N
i
i n
E
t n
p
t n
p
N
a
) 3 . (
12 . 0
2
sin
6
1 2
sin
2
12
1 1
E
t n
p
t n
p
N
b
i
i
i
i
N
i
i n
= =
= =
Solution:
Since the given pressure fluctuations repeat every 0.12 s, the period is = 0.12 s
and the circular frequency of the first harmonic is 2 radians per 0.12 s or
=2 /0.12 = 52.36 rad/s. As the number of observed values in each wave (N) is 12,
We obtain
n=1 n = 2
i t
i
p
i
1 0.01 20000 17320 10000 10000 17320
2 0.02 34000 17000 29444 -17000 29444
3 0.03 42000 0 42000 -42000 0
4 0.04 49000 -24500 42434 -24500 -42434
5 0.05 53000 -45898 26500 26500 -45898
6 0.06 70000 -70000 0 70000 0
7 0.07 60000 -51960 -30000 30000 51960
8 0.08 36000 -18000 -31176 -18000 31176
9 0.09 22000 0 -22000 -22000 0
10 0.10 16000 8000 -13856 -8000 -13856
11 0.11 7000 6062 - 3500 3500 -6062
12 0.12 0 0 0 0 0
409000 -161976 49846 8500 21650
-26996.0 8307.7 1416.7 3608.3
12 . 0
2
cos
i
t
i
P
12 . 0
2
sin
i
t
i
P
12 . 0
4
cos
i
t
i
P
12 . 0
4
sin
i
t
i
P
=
12
1
) (
6
1
i
=
12
1
) (
i
From these calculations, the Fourier series expansion of the pressure fluctuations p(t)
can be obtained as
2
/ . .......... 72 . 104 sin 3 . 3608 72 . 104 cos 7 . 1416
36 . 52 sin 7 . 8307 36 . 52 cos 0 . 26996 3 . 34083 ) (
m N t t
t t t p
+ +
+ =
) 4 . (E
FOURIER SERIES
IN
EXPONENTIAL FORM
) 1 ( sin cos t i t e
t i
+ =
) 2 ( sin cos t i t e
t i
+
=
and
) 4 (
2
sin
i
e e
t
t i t i
=
Fourier expansion can be written as
( )
=
)
`
|
|
.
|
\
|
+
|
|
.
|
\
|
+
+ =
1
0
2 2 2
n
t in t in
n
t in t in
n
i
e e
b
e e
a
a
t x
( )
) 5 (
2 2 2 2
2 2
1
0 0
0
)
`
|
.
|
\
|
+ +
|
.
|
\
|
+
|
.
|
\
|
=
n
n n
t in
n n
t in
t i
ib a
e
ib a
e
ib a
e
where b
0
= 0. By defining the complex Fourier coefficients c
n
and c
-n
as
) 6 (
2
n n
n
ib a
c
=
and
) 7 (
2
n n
n
ib a
c
+
=
=
=
n
t in
n
e c t x
The Fourier coefficients c
n
can be determined as
( )| |
=
=
0
0
) 9 ( ) (
1
sin cos
1
2
dt e t x
dt t n i t n t x
ib a
c
t in
n n
n
The harmonic functions a
n
cos nt or b
n
sin nt are called
the harmonics of order n of the periodic function x(t). The
harmonic of order n has a period /n. These harmonics can be
plotted as vertical lines on a diagram of amplitude (a
n
and b
n
or d
n
and
n
) versus frequency (n), called the frequency
spectrum or spectral diagram. Figure 1 shows a typical
frequency spectrum.
Frequency Spectrum
Fig. 1 Frequency Spectrum of a typical periodic function of time
Fig. 2 Representation of a function in time and frequency domains
Fourier Analysis
Any periodic function x(t), of period , can be expressed in
the form of a complex Fourier series
( ) ) 10 (
0
=
=
n
t in
n
e c t x
where
0
is the fundamental frequency given by
) 11 (
2
0
=
and the complex Fourier coefficients c
n
can be determined by
multiplying both sides of Eq.(10) with and integrating
over one time period:
t im
e
0
:
=
=
2 /
2 /
2 /
2 /
) (
0 0
) (
n
t m n i
n
t im
dt e c dt e t x
( ) ( ) | | ) 12 ( sin cos
2 /
2 /
0 0
dt t m n i t m n c
n
n
=
+ =
Equation (12) can be simplified to obtain
=
2 /
2 /
) 13 ( ) (
1
0
dt e t x c
t in
n
Equation (10) shows that the function x (t) of period can be
expressed as sum of an infinite number of harmonics. The
harmonics have amplitudes given by Eq. (13) and
frequencies which are multiples of the fundamental
frequency
0
. The difference between any two consecutive
frequencies is given by
( ) ) 14 (
2
1
0 0 0 1
= = = + =
+
n n
n n
Thus the larger the period , the denser the frequency
spectrum becomes. Equation (13) shows that the Fourier
coefficients c
n
are, in general, complex numbers. However, if
x(t) is a real and even function, then c
n
will be real. If x(t) is
real, the integrand of c
n
in Eq. (13) can be also be identified as
the complex conjugate of that of c
-n
. Thus
) 15 (
*
n n
c c
=
The mean square value of x (t) - that is , the time average
of the square of the function x (t) can be determined as
dt e c dt t x t x
n
t in
n
2
2 /
2 /
2 /
2 /
2 2
0
1
) (
1
) (
|
|
.
|
\
|
= =
( ) dt c e c e c
dt e c c e c
n
t in
n
t in
n
n n
t in
n
t in
n
2
1
0
*
2 /
2 /
2
2 /
2 /
1
1
0
0 0
0 0
1
1
)
`
+ + =
|
|
.
|
\
|
+ + =
dt c c c
n
n n
=
)
`
+ =
2 /
2 /
1
2
0
*
2
1
=
= + =
n
n
n
n
c c c
2
2
1
2
0
2
(16)
Complex Fourier Series Expansion
Example:Find the complex Fourier series expansion of the
function shown in Fig. 3
Solution: The given function can be expressed as
) 1 . (
2
0 , 1
0
2
, 1
) ( E
t
a
t
A
t
a
t
A
t x
|
.
|
\
|
|
.
|
\
|
+
=
= =
2
0
and
(E.2)
Figure 3 Complex Fourier series representation.
The Fourier coefficients can be determined as
) 3 . ( 1 1
1
) (
1
0
2 /
2 /
0
2 /
2 /
0 0
0
E dt e
a
t
A dt e
a
t
A
dt e t x c
t in t in
t in
n
(
|
.
|
\
|
+
|
.
|
\
|
+ =
=
c
n
can be evaluated as
| |
0
2 /
0
2
0
0
2 /
0
1
) (
1
0
0
)
`
= t in
in
e
a
A
e
in
A
c
t in
t in
n
| |
(
(
)
`
2 /
0
0
2
0
2 /
0
0
1
) (
0
0
t in
in
e
a
A
e
in
A
t in
t in
(E.5)
This equation can be reduced to
+ =
in in in in
n
e
n a
A
e
n a
A
e
in
A
n a
A
e
in
A
c
2
0
2 2
0
2
0
2
0
2
0
1 1 1 2 1
( ) ( ) ) 6 . (
1 1
2
0
2 2
0
2
E e in
n a
A
e in
n a
A
in in
(
(
+
Noting that
in
e ) 7 . (
,....... 6 , 4 , 2 , 1
,....... 5 , 3 , 1 , 1
0 , 1
E
n
n
n
e
in
=
=
=
=
or
Eq. (E.6) can be simplified to obtain
) 8 . (
,...... 6 , 4 , 2 , 0
,...... 5 , 3 , 1 ,
2 4
0 ,
2
2 2 2
0
2
E
n
n
n
A
n a
A
n
A
c
n
=
= =
|
|
.
|
\
|
=
=
The frequency spectrum is shown in Fig.3(b)
Figure 4 Nonperiodic function
Fourier Integral
A nonperiodic function, such as the one shown by the
solid curve in Fig. 4, can be treated as a periodic function
having an infinite period The Fourier series
expansion of a periodic function is given by Eqs.(10),
(11) and (13)
( ).
) 17 ( ) (
0
=
=
n
t in
n
e c t x
with
) 18 (
2
0
=
and
=
2 /
2 /
) 19 ( ) (
1
0
dt e t x c
t in
n
As the frequency spectrum becomes continuous
and the fundamental frequency becomes infinitesimal.
Since the fundamental frequency
0
is very small, we
can denote it as , n
0
as , and rewrite Eq. (19) as
( ),
= = ) 20 ( ) ( ) ( lim lim
2 /
2 /
dt e t x dt e t x c
t i t i
n
By defining X () as
) 21 ( ) ( ) ( lim ) ( dt e t x c X
t i
n
= =
we can express x(t) form Eq. (17) as
=
=
n
t i
n
e c t x
2
2
lim ) (
( )
2
1 2
lim
|
.
|
\
|
=
=
t i
n
n
e c
) 22 ( ) (
2
1
d e X
t i
This equation indicates the frequency decomposition
of the nonperiodic function x(t) in a continuous
frequency domain, similar to Eq. (17) for a periodic
function in a discrete frequency domain. The
equations
d e X t x
t i
) (
2
1
) (
(23)
and
dt e t x X
t i
=
) ( ) (
(24)
are known as the (integral) Fourier transform pair for
a nonperiodic function x(t) , similar to Eqs. (17) and
(19) for a periodic function x(t)
The mean square value of a nonperiodic function x(t)
can be determined from Eq. (16)
2
2 /
2 /
2
) (
1
=
=
n
n
c dt t x
=
=
|
.
|
\
|
= =
n
n n
n
n n
c c c c
2
0 *
0
0 *
( )( )
2
1
0 *
n
n
n
c c
=
=
(25)
, , ) ( ), (
0
* *
as d and X c X c
n n
Since Eq. (25) gives the mean square value
of x(t) as
d
X
dt t x t x
2
2 /
2 /
2 2
2
) (
) (
1
lim ) (
= =
(26)
Equation (26) is known as Parsevals formula for
nonperiodic functions
FourierTransform of a Triangular Pulse
Example:
Find the Fourier transform of the triangular pulse
shown in Fig. 5
Solution: The triangular pulse can be expressed as
|
|
.
|
\
|
=
otherwise
a t
a
t
A
t x
, 0
, 1
) (
(E.1)
( ) dt e
a
t
A X
t i
|
|
.
|
\
|
=
1
dt e
a
t
A dt e
a
t
A
t i t i
|
.
|
\
|
+
|
.
|
\
|
+ =
0
0
1 1
The Fourier transform of x(t) can be found, using
Eq.(24), as
(E.2)
Fig. 5 Fourier transform of a triangular Pulse
Since x(t) = 0 for | t | >0, Eq.(E.2) can be expressed
as
dt e
a
t
A dt e
a
t
A X
t i
a
t i
a
|
.
|
\
|
+
|
.
|
\
|
+ =
1 1 ) (
0
0
| |
0
2
0
1
) (
a
t i
a
t i
t i
i
e
a
A
e
i
A
)
`
+
|
.
|
\
|
| |
a
t i
a
t i
t i
i
e
a
A
e
i
A
0
2
0
1
) (
)
`
|
.
|
\
|
(E.3)
Equation (E.3) can be simplified to obtain
( )
|
.
|
\
|
+
|
.
|
\
|
+ =
2 2 2
2
a
A
e
a
A
e
a
A
X
a i a i
( ) ( ) a i a
a
A
a i a
a
A
a
A
sin cos sin cos
2
2 2 2
+ =
( ) ) 4 . (
2
sin
4
cos 1
2
2
2 2
E
a
a
A
a
a
A
|
.
|
\
|
= =
=
T
ik t
k
T
C f t e dt
T
0
2 / and 0,1, 2,.... = = T k
4.5 Fourier Integral and Transforms
Fourier series is a useful tool for investigating the spectrum of a periodic
function. But, there are many wave forms that do not repeat themselves regularly
(ex: lightening bold, disturbance from the random signals of machines etc).
Alternative to Fourier series, Fourier integrals is the primary tool available for this
purpose. This can be derived from exponential form of the Fourier series.
(22)
where (23)
where
0
~
( )
=
=
ik t
k
k
f t C e
The transition from a periodic to a nonperiodic function can be effected by
allowing the period to approach infinity. In other words, as T becomes infinite, the
function never repeats itself and thus becomes aperiodic. If this is allowed to
occur, Fourier series reduces to
0
0 0
1
( ) ( )
2
i t
f t F i e d
=
(24)
and the coefficients become a continuous function of the frequency variable
as in
0
0
( ) ( )
i t
F i f t e dt
=
(25)
The function
0
( ) F i as defined in Eqn (25) is called Fourier integral of ( ) f t ,
Eqns (24) and (25) are collectively referred to as the Fourier transform pair.
0
( ) F i is also called the Fourier transform of ( ) f t . ( ) f t is called inverse Fourier
transform of
0
( ) F i .
Difference between Fourier series and transform.
Fourier series Fourier transform
Applied to periodic waveforms.
Converts a continuous, periodic time-
domain function to frequency domain
magnitudes at discrete frequencies
Applied to nonperiodic waveforms.
Converts a continuous time-domain
function to a continuous frequency-
domain function.
The discrete frequency spectrum generated by the Fourier series is
analogous to a continuous frequency spectrum generated by the Fourier transform.
The shift from a discrete to continuous spectrum is illustrated in Fig. 8.
Fig. 8.
Illustration of how the
discrete frequency
spectrum of a Fourier
series for a pulse train
(a) approaches a
continuous frequency
spectrum of a Fourier
integral (c) as the
period is allowed to
approach infinity.
Fig. 8a shows a pulse train of rectangular wave with pulse widths equal to
one-half the period along with its associated discrete spectrum.
In Fig. 8b, a doubling of the pulse trains period has two effects on the
spectrum. First, two additional frequency lines are added on either side of the
original components. Second, the amplitudes of the components are reduced.
As the period is allowed to approach infinity, these effects continue as
more and more spectral lines are packed together until the spacing between lines
goes to zero. At the limit, the series converges on to the continuous Fourier
integral as shown in Fig. 8c.
Signal is rarely characterized as a continuous function of the type needed
to implement Eqn (25). The data is invariably in a discrete form. The completion
of Fourier transform for such a discrete measurement is shown in the next
section.
4.6 Discrete Fourier Transform
Functions are often represented by finite sets of discrete values as shown
in Fig. 9. An interval from 0 to T is divided into N equispaced subintervals with
width T= T/N.
Fig. 9.
The sampling points of the discrete Fourier series.
n- discrete times at which the sample is taken
f
n
- value of function f(t) taken at t
n
where data points are specified at n=0,1,2,..N-1, a discrete Fourier transform
for data shown can be written as
0
1
0
for 0 to 1
N
ik n
k n
n
F f e k N
=
= =
(26)
and the inverse Fourier transform as
0
1
0
1
for 0 to 1
N
ik n
n k
k
f F e n N
N
=
= =
(27)
where
0
2 / N =
Pseudocode for computing the DFT:
DOFOR k= 0 to N-1
DOFOR n= 0 to N-1
angle = k
0
n
real
k
= real
k
+ f
n
cos(angle)/N
imaginary
k
= imaginary
k
f
n
sin(angle)/N
ENDDO
ENDDO
4.7 Fast Fourier Transform (FFT)
The DFT algorithm explained in the above section can serve the purpose,
but is computationally expensive (N
2
operations are required).
The Fast Fourier Transform (FFT) is an algorithm developed to compute
DFT in an extremely economical fashion. It utilizes the results of previous
computations to reduce the number of operations. It exploits the periodicity and
symmetry of trigonometric functions to compute the transform with approximately
N log
2
N operations. (For N=50 samples, FFT is about 10 times faster than DFT.
N=1000, it is 100 times faster).
In FFT algorithms, a DFT of length N is decomposed or decimated into
successively smaller DFTs. Cooley-Tukey algorithm is a decimation-in-time
technique and Sande-Tukey algorithm is decimation-in-frequency technique.
(a) Cooley-Tukey Algorithm
This algorithm assumes that N is an integral power of 2, i.e. N=2
m
, where
m is an integer. The basic idea of this algorithm is to decompose the N-point DFT
into two N/2-point DFTs, then decompose each of the N/2-point DFTs into two
N/4-point DFTs and continuing this process until N/2 two-point DFTs are
obtained. The number of steps required to achieve this is clearly m. For easy
understanding of this algorithm, N=8 is considered and it can be easily
generalized. The first step (or stage) of the algorithm is described below:
Let
0 1 2 7
, , ,.... f f f f be a sequence of values of ( ) f t . The DFT for
n
f is given by
7
8
0
, 0,1, 2,...7
kn
k n
n
F f W k
=
= =
(1)
where
2 / 8
8
i
W e
= (2)
The summation on the right side of Eqn (1) is split into two equal parts of length
4, one containing the even-indexed values of ( ) f t and the other of the odd-
indexed values. They can be written as
8 8
( ) ( )
nk nk
k n n
n even n odd
F f W f W = +
(3)
Putting 2 n r = in the first sum and 2 1 n r = + in the second sum of Eqn (3), we
obtain
3 3
2 (2 1)
2 8 2 1 8
0 0
kr r k
k r r
r r
F f W f W
+
+
= =
= +
(4)
But
2 2 (2 ) / 8 2 / 4
8 4
kr i kr ikr kr
W e e W
= = = (5a)
and
(2 1) 2
8 8 8 8 4
r k rk k k kr
W W W W W
+
= = (5b)
Using Eqn (5) in Eqn (4), we get
3 3
2 4 8 2 1 4
0 0
rk k rk
k r r
r r
F f W W f W
+
= =
= +
(6)
It is easily seen that the two sums on the right side of Eqn (6) represent 4-point
DFTs. Setting
3
2 4
0
e kr
k r
r
F f W
=
=
(7a)
3
2 1 4
0
o kr
k r
r
F f W
+
=
=
(7b)
Eqn (6) becomes:
8
, 0,1, 2, 3,
e k o
k k k
F F W F k = + = (8)
where
e
k
F and
o
k
F are the 4-point DFTs of the even and odd-indexed sequences
defined by Eqn (7). This completes the first stage of decomposing the 8-point
DFT into two 4-point DFTs. Further, to compute Eqn (8) for k=4,5,6,7 we use the
formula:
4 8 4
, 4, 5, 6, 7
e k o
k k k
F F W F k
= + = (9)
The computations involving equations Eqns (8) and (9) for the first stage of the 8-
point DIT-FFT are shown in flow-graph in Fig. 10.
Fig. 10. First stage of the 8-point DIT-FFT.
In the second stage, each of the 4-point transforms in Eqn (8) is decomposed
into two 2-point transforms. We then write
3
2 4
0
1 1
4 2 4 4 2 2
0 0
4
=
+
= =
=
= +
= +
e kr
k r
r
sk k sk
s s
s s
ee k eo
k k
F f W
f W W f W
F W F
(10)
where
1 1
4 2 4 2 2
0 0
and
ee sk eo sk
k s k s
s s
F f W F f W
+
= =
= =
(11)
Similarly, we obtain
4
o oe k oo
k k k
F F W F = + (12)
where
1 1
4 1 2 4 3 2
0 0
and
oe lk oo lk
k l k l
l l
F f W F f W
+ +
= =
= =
(13)
This completes the second stage of decomposition where each of the 4-point
transforms is broken into two 2-point transforms. The flow-graph of the second
stage is shown in Fig. 11.
Fig. 11. second stage of the decomposition.
From Eqn (10), we have
1
4 2 0 2 4 2
0
ee sk o k
k s
s
F f W f W f W
=
= = +
(14a)
1
4 2 2 2 2 6 2
0
eo sk o k
k s
s
F f W f W f W
+
=
= = +
(14b)
Eqns (14a) and (14b) show that at the third stage (which is the final stage, since
N=8), we obtain
0 4 2 6
, , ,
eee eeo eoe eoo
k k k k
F f F f F f F f = = = = (15)
It follows that, for the 8-point computation, we start with the input sequence
0 4 6 1 5 3 7
, , , , , and , f f f f f f f and then compute the various Fourier coefficients.
Fig. 12. Flowgraph of an 8-point DIT-FFT
A close inspection of Fig. 12 enables us to make the observations:
(i) The input data is shuffled and are in the order
0 4 2 6 1 5 3 7
, , , , , , , an d . f f f f f f f f they are in the bit-reserved order, as shown
in Table 1.
Table 1. Input Data in the Reserved Bits
Input position Binary equivalent Reverse bits Index of the sequence
0
1
2
3
4
5
6
7
000
001
010
011
100
101
110
111
000
100
010
110
001
101
011
111
0
4
2
6
1
5
3
7
(ii) The output dats for the Fourier coefficients
n
F is in the natural order.
(iii) The computations are carried out in terms of a fundamental molecule
called butterfly. A typical butterfly is shown in Fig. 13, where i and j
represent the position numbers in the stage and m represents the stage
of the computation.
Fig. 13. A typical butterfly.
The outputs
1 1
and
m m
i j
g g
+ +
are given by
1 1
,
m m r m m m r m
i i N j j i N j
g g W g g g W g
+ +
= + = (16)
where r is a variable depending on the position of the butterfly.
The method of computation is illustrated in the following numerical
example.
Example 4.3. Using the Cooley-Tukey algorithm, find the DFT of sequence
{ }
1, 2, 3, 4, 4, 3, 2,1
n
f = .
We have
0 1 2 / 8 2 2 / 8 2
8 8 8
3 4 5
8 8 8
6 7
8 8
1, (1 ) / 2, ( ) ,
(1 ) / 2, 1, (1 ) / 2,
, (1 ) / 2
i i
W W e i W e i
W i W W i
W i W i
= = = = =
= + = =
= = +
The DIT-FFT flowgraph for DFT computation is given below in Fig. 14.
Fig. 14.
Flowgraph for Example 4.3