0% found this document useful (0 votes)
39 views106 pages

NSPCH 4

The document discusses different techniques for transforming data points into curves including manually derived least squares fitting, mathematical least squares fitting for linear and quadratic models, and Fourier analysis. Fourier analysis represents data using trigonometric functions which can model periodic signals and phenomena with oscillations. The key aspects covered are representing signals as sinusoidal functions, performing least squares fitting of sinusoidal models, and an example of applying this technique.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views106 pages

NSPCH 4

The document discusses different techniques for transforming data points into curves including manually derived least squares fitting, mathematical least squares fitting for linear and quadratic models, and Fourier analysis. Fourier analysis represents data using trigonometric functions which can model periodic signals and phenomena with oscillations. The key aspects covered are representing signals as sinusoidal functions, performing least squares fitting of sinusoidal models, and an example of applying this technique.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 106

Transform Techniques

(a)Manually derived least square fit


Set of points smoothened by a hand drawn curve and by
linear least square fit. (Shown in Fig.4.1)
Point X Y Y

P1 -2.1 -1.8 -1.8


P2 -0.9 -2.0 -0.9
P3 -0.6 0.4 -0.7
P4 -0.1 -1.9 -0.6
P5 1.0 0.5 -0.2
P6 1.8 -1.4 -0.05
P7 2.4 1.3 0.1
P8 3.7 -0.3 0.3
P9 4.2 0.9 0.4
P10 4.8 0.2 0.6
P11 6.0 2.2 1.4
P12 6.8 2.1 2.1
Table 4.1
Fig.4.1
y are corresponding coordinates as measured on
manually drawn curve.
Difference between y and y represents the degree of
smoothness in a subjective sense.
y must be regarded as the best fit for a set of
empirical data.
Regardless of the curve, goodness of fit is often
measured by a correlation coefficient, R.
In essence, R is a measure of the usefulness of x as
a predictor of y.
In statically terms R
2
is computed by subtracting from
unity, the ratio of the variance of the y data w.r.t. the
fitted or assumed curve over the data w.r.t. the
average of ys.
1/n (y
i
-y)
1/n (y
i
-)
2
R
2
= 1-
(4.1)
Where = average of ys
By substituting the given values in Eqn.(4.1)
R
2
= 0.63, R = 0.79.
If the curves were to pass through each point, the
numerator of the fraction in Eqn.4.1.
Would become zero and R
2
would become unity.
When the curve y does not improve the fit, the
numerator of the fraction would be the same as the
denominator and R
2
would be zero.
From this we can say that R 1,better the predicted
values of y.
(b)Mathematical least square (Linear fit)
For a best linear fit to a set of data, we must
determine
y = A
0
+ A
1
x
And a sum of squared deviations between y and the
ys of data points is a minimum.
From the statistics, the following two linear equations
in A
0
and A
1
will fulfill these requirements.
A
0
1 + A
1
x
i
= y
i
A
0
x
i
+ A
1
x
i
2
= x
i
y
i
(4.2)
(4.3)
(4.4)
From the data given in the table 4.1
12A
0
+ 27A
1
= 0.2
27A
0
+ 152.2A
1
= 37.74
Solving
A
0
= -0.92, A
1
= 0.41
y = 0.92 + 0.41x
Then compute R
2
using the appropriate formula when
(4.6)
(4.5)
= (-1.8-2.0+0.4+. +6.8)/12 and y is determined
for the xs, that is, for 2.1, -0.9, etc.
Then R
2
is found to be 0.60 which indicates that y is
somewhat better in predicting y as a function of x
than y (which does not vary with x).
(c)Mathematical least square (quadratic) fit
By using a second degree polynomial, the least square
equation could be represented as
y = A
0
+A
2
x
2
Then As could be derived from the set of linear equations:
A
0
1+A
1
x
i
+A
2
x
i
2
= y
i
A
0
x
i
+A
1
x
i
2
+A
2
x
i
3
= x
i
y
i
A
0
x
i
2
+A
1
x
i
3
+A
2
x
i
4
= x
i
2
y
i
(4.8)
(4.9)
(4.10)
(4.7)
By inspection of the equations for the As for the linear fit
and the quadratic fit and by simple extension, it is possible
to write the formation equations to any desired degree.
We limit to N-1 degree polynomial to pass through N points.
Higher the selected degree of polynomial fit, the
closer the resulting curve will be to each point.
But the curve will wiggle to fulfill the effect.
Graphics can be of considerable assistance in
determining the most practical order of polynomial
fitting, since the magnitude of R
2
is not a criterion by
itself.
How least square polynomial fitting approaches the
data points with higher degree function is illustrated
in the following example
The average of the ys
y= (0+1+0-2)/4= -1/4
Making use of eqn. (4.5) and (4.6)
4A
0
+ 2A
1
= -1
2A
0
+ 6A
1
= 4
Solving Eq. (4.11)
A
1
= -7/10 and A
0
= 1/10
Ex.
Four points are (-1,0), (0,1), (1,0), and (2,-2).Draw
linear, quadratic and cubic least square polynomial fits.
(4.11)
Now equation for linear fit can be written as
Y = 1/10 (7/10)x
similarly equations for quadratic and cubic fit can be
written as
y = 17/20 +(1/20)x ()x
2
y = 1- x/6 x
2
+x
3
/6
(4.12)
(4.13)
(4.14)
The four points and the three polynomials least squares fits
are shown in Fig.4.2
Fig.4.2
-1 -0.5 0 0.5 1 1.5 2
-2
-1.5
-1
-0.5
0
0.5
1
1.5
(-1,0)
(0,1)
(1,0)
(2,-2)
Fourier Analysis
4.0 Introduction
Engineering problems involve systems with oscillation or vibration. Trigonometric
functions play a fundamental role in modeling such problems. Fourier
approximation represents a systematic frame work for using trigonometric series
for this purpose. The important aspect of Fourier analysis is that it deals with both
the time and the frequency domains.

4.1 Curve fitting with sinusoidal functions
Periodic functions repeat after a time period T.
Common examples: Waveforms such as square and saw tooth. Some periodic
functions are shown in Fig.1.
( ) ( ) f t f t T = +
(1)

Fig.1 Periodic functions
Idealized forms
(a) the square wave and
(b) The saw tooth wave.
Periodic signals in nature can be
(c) Nonideal
(d) Contaminated by noise.
All these cases can be represented and
analyzed by the trigonometric functions.
The most common periodic functions are sinusoidal. The term sinusoid represents
any wave that can be described as a sine or cosine. There are no guidelines for
choosing either sine or cosine function. In any case the results will be identical. A
cosine function can be generally expressed as

) ( cos ) (
1
+ + = t C A t f
o o

A plot of sinusoidal function is shown in Fig.2.



Fig.2.
(a) A plot of sinusoidal function
(b) An alternative for the same curve








The following four parameters serve to characterize the sinusoid
(i) The mean value, A
o
sets the average height above the abscissa
(ii) The amplitude, C
1
, specifies height of the oscillation.
(iii) The angular frequency,
o
, characterizes how often the cycle occur.
(iv) The phase angle or phase shift, , parameterizes the extent to which the sinusoid is
shifted horizontally. It can be measured as the distance in radians from t = 0 to the point
at which the cosine function begins a new cycle. A positive is referred as leading phase
angle and negative value is referred as lagging phase angle.
The angular frequency (rad / s) is related to frequency (cycles / s) by

0
2 f =
(3)
And the frequency in turn is related to period T by

1
f =
T
(4)
Eqn. (2) is adequate mathematical characterization of a sinusoid, is not good
from the standpoint of curve fitting because the phase shift is included in the
argument of the cosine function. This deficiency can be overcome by invoking
the trigonometric identity.
1 0 1 0 0
cos( ) cos( )cos sin( )sin C t C t t
(

+ = (5)
Substituting Eqn. (5) into Eqn. (2), gives

0 1 0 1 0
( ) cos( ) sin( ) f t A A t B t = + + (6)
Where
sin ; cos
1 1 1 1
C B C A = = (7)
From Eqn. (7)

1
1 1
tan ( / ) B A

= (8)
And
2 2
1 1 1
C A B = + (9)
Refer Eqn (2), RHS cosine term can be written as
0 0
cos( ) sin( 2) t t + = + + (10)
These two represent the same function with phase shift
2

.
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

= is called fundamental frequency and its constant multiples


0 0
2 , 3 , etc., are
called harmonics.
Eqn (17) expresses ( ) f t as a linear combination of the basic functions: 1, cos (
0
t),
sin (
0
t), cos (2
0
t), sin (2
0
t).
The coefficients in Eqn. (17) can be computed using the relations
0
0
2
( ) cos( )
T
T
k
a f t k t dt =

(18)

0
0
2
( )sin( )
T
T
k
b f t k t dt =

(19a)
For k = 1,2,.
and
0
0
1
( )
T
T
a f t dt =

(19b)
Example 4.2.
Use the continuous Fourier series to approximate the square or rectangular
wave function as shown in Fig.3
1 / 2 / 4
( ) 1 / 4 / 4
1 / 4 / 2
T t T
f t T t T
T t 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 equation of motion for a spring, mass damper


system can be expressed as
) 5 ( sin cos ) (
1 1
0
. ..
t j b t j a a t F kx x c x m
j
j
j
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

EXAMPLE 1: Periodic Vibration of a Hydraulic


Valve
In the study of vibrations of valves used in hydraulic
control systems, the valve and its elastic stem are
modeled as a damped spring mass system, as
shown in Fig 1(a). In addition to the spring force
and damping force, there is a fluid pressure force on
the valve that changes with the amount of opening
or closing of the valve. Find the Fourier series terms
of the valve when the pressure in the chamber
varies as indicated in Fig.1. Assume k = 2500 N/m,
c = 10N-s/m, and m = 0.25kg.
Solution: The valve can be considered as a mass
connected to spring and a damper on one side
and subjected to a forcing function F(t) on the
other side.
The forcing function can be expressed as
F(t)=Ap(t) (E.1)
Fig. 1 Periodic vibration of a hydraulic valve
where A is the crosssectional area of the chamber,
given by
) 2 . ( 000625 . 0 625
4
) 50 (
2 2
2
E m mm A

= = =
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

the Fourier coefficients a


j
and b
j
can be computed
with the help of Eqs. (3) and (4):
) 5 . ( 000 25 ) 2 ( 000 50 000 50
2
1
1
0
2
1
0
E A dt t A dt At a =
(

+ =

) 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

Once the Fourier coefficients a


o
, a
j
, and b
j
are
known, the steady state response of the system
can be found using Eq.(14) with
) 4 (
2
|
|
.
|

\
|
=
n
r

Response under a Periodic Force of Irregular


form
Example 2: The pressure fluctuations of water in a
pipe, measured at 0.01 second intervals, are given in
Table below. These fluctuations are repetitive in
nature. Make a harmonic analysis of the pressure
fluctuations and determine the first two harmonics of
the Fourier series expansion.
Time, t
i
(second
s)
0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.11 0.12
p
i
= p(t
i
)
(kN/m
2
)
0 20 34 42 49 53 70 60 36 22 16 7 0
Fig. 2 An irregular forcing function


= =
= = = =
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

Complex Fourier Series


The Fourier series can also be represented in terms of
complex numbers. By noting,
and
cos t and sin t can be expressed as
) 3 (
2
cos
t i t i
e e
t


+
=
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
+
=

Eq(5) can be expressed as


( ) ) 8 (

=
=
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


|
.
|

\
|


|
.
|

\
|
+
=

where the period () and the fundamental frequency (


0
) are
given by
a 2 =
a

= =
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
(

|
.
|

\
|
+
|
.
|

\
|
+ =
=

Using the relation


) 4 . ( ) 1 (
2
E kt
k
e
dt te
kt
kt
=

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
|
.
|

\
|
= =

Equation (E.4) is plotted in Fig. 5 (b). Notice the


similarity of this figure with the discrete Fourier
spectrum shown in Fig.3 (b).
Fig. 5
(a) A depiction of how a sinusoid can be portrayed in the time and the frequency
domains. The time projection is reproduced in (b), whereas the amplitude-
frequency projection is reproduced in (c). The phase-frequency projection is
shown in (d)
Fig. 5 shows a three dimensional graph of a sinusoidal function
1
( ) cos( / 2) f t C t = +
In the above equation the magnitude or amplitude of the curve ( ) f t is the
dependent variable. Time, t, and frequency
0
f / 2 = are independent
variables.
Thus,
(i) The amplitude and time axis form a time plane.
When we speak about the behavior of the sinusoid in the time domain, it is
the projection of the curve onto the time plane (Fig. 5b).
Fig. 5c shows a projection of the measure of the sinusoids maximum
positive amplitude C
1
. The full peak-to-peak swing is unnecessary because of the
symmetry. Hence, Fig. 5c defines the amplitude and frequency of the sinusoid.
This information is sufficient to produce the shape and size of the curve in the
time domain.
(ii) The amplitude and frequency axis form a frequency plane.
The behavior of the sinusoid in the frequency domain is merely its
projection onto the frequency plane.
The phase angle is determined as the distance (in radians) from zero to
the point at which positive peak occurs. If the peak occurs after zero, it is said to
be delayed, and by convention, the phase angle is given a negative sign.
Conversely, a peak before zero is said to be advanced and the phase angle is
positive. In Fig. 5d, the peak leads zero and the phase angle is plotted as + / 2 .
Fig. 5c and d provide an alternative way to present the pertinent features of the
sinusoid in Fig. 5a. They are referred to a line spectra.
Fig. 6 shows some other possibilities.
Fig. 6
Various phases of a sinusoid showing the associated phase line spectra.
Fig. 7
(a) amplitude and
(b) phase line spectra for the square wave from Fig. 3.
Fig. 7 shows the amplitude and phase line spectra for the square wave function
from the Example 4.2. The original square wave shown in Fig. 4,( of
CONTINUOUS FOURIER SERIES section) tells us nothing about the sinusoids
that comprise it. The alternative to display these sinusoids
0 0 0
(4/ ) cos( ), -(4/ 3 ) cos(3 ), (4/ 5 ) cos(5 ), etc. t t t
This alternative does not provide an adequate visualization of the structure of
these harmonics.

In contrast, Figs. 7(a) and (b) provide a graphic display of this structure. The line
spectra represent fingerprints that can help to characterize and understand a
complicated waveform. They are particularly useful for nonidealized cases where
they sometimes allow to discern structure in otherwise obscure signals.

Fourier transform will allow to extend such analysis to nonperiodic waveforms.
0
2
~
2
1
( )

=

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

You might also like