While studying heat conduction in materials, Baron Fourier (a title given to him by
Napoleon) developed his now famous Fourier series, approximately 120 years after
Newton published the first book on calculus. It took Fourier another twenty years to
develop the Fourier transform which made the theory applicable to a variety of
disciplines such as signal processing where Fourier analysis is now an essential tool.
Fourier did little to develop the concept further and most of that work was done by
Euler, LaGrange, Laplace and others. Fourier analysis is now also used in thermal
analysis, image processing, quantum mechanics and physics.
Fourier noticed that you can create some really complicated looking waves by just
summing up simple sine and cosine waves. For example, the wave in Figure 1a is sum
of the just three sine waves shown in Figures 1b, 1c and 1d of assorted frequencies and
amplitudes.
Let’s look at signal 1a in three dimensions. With time progressing to the right we
see the amplitude going up and down erratically, we are looking at the signal in Time
domain. From this angle, we see the sum of the three sine waves as shown in Fig
(1b,c,d).
When we look at the same signal from the side along the z-axis, what we see are the
three sine waves of different frequencies. We also see the amplitude but only as a line
with its maximum excursion. This view of the signal from this point of view is called
the Frequency Domain. Another name for it is the Signal Spectrum.
The concept of spectrum came about from the realization that any arbitrary wave is
really a summation of many different frequencies. The spectrum of the composite wave
f(t) of Fig (1) is composed of just three frequencies and can be drawn as in Fig (3.1).
Now let’s look at the signal in frequency domain. Think of it as a recipe, with x-
axis showing the ingredient and the y-axis, how much of that ingredients. The x-axis
for a signal would show the different frequencies in the signal and y-axis the amplitude
of each of those frequencies.
Let’s expand on this concept. V-8 juice for example has many different ingredients
such as celery juice, salt, water, spices, etc.. We can remove most of these ingredients
one by one and the remaining liquid would still taste essentially like V-8. What we can
not remove and have the item still retain its primary character is called the
fundamental component. In V-8, that is tomato juice.
The first thing we notice is that the wave is periodic. Fourier analysis tells us that
any arbitrary wave such as the above that is periodic, can be represented by a sum of
other simpler waves.
Let’s try summing a bunch of sine waves to see what they look like.
Each of the waves here have frequencies that are integer multiples. In more
scientific words, we say that they are harmonic to each other, similar to musical notes
which are also called harmonic.
N
f (t ) = ∑ sin(n ω t ) (1)
n =1
Each wave has a frequency that is integer multiple of the starting frequency ω,
which is equal to 2π (1) in this case since f = 1 Hz. Here is what a sum of four sine
waves of equal amplitude, each starting with a phase of 0 degrees at time 0 looks like.
Figure 6 - This is the sum of all four of the above sine waves.
In the graph above, we allowed the amplitude of each harmonic to be one. Going to
the next level of abstraction, it is obvious that to represent an arbitrary wave, we need
to allow the amplitude of each component to vary. Otherwise, all we will get is the
scaled version of the signal in Fig (7). So we modify equation (1) by introducing a
coefficient an to represent the amplitude of the nth sine wave as follows:
N
f (t ) = ∑ an sin(n ω t ) (2)
n =1
The coefficient an allows us to vary the amplitude of each harmonic fn(t) = sin(nωt)
to create a variety of waves. Here is what one particular wave which is the sum of four
sine waves of unequal amplitude looks like.
But looking at the original wave, f(t) in Fig (4), we see that it starts at a non-zero
value. No matter how many sine waves we add together, we can not replicate this wave
because sine waves are always zero at time zero. But if we add some cosine waves to
the sum in equation (2) which do not start at zero, we may be able to create the wave of
Figure 2.
Once again the sum of the cosine waves of equal amplitude looks like this.
• Even function – The function that is symmetrical about the y-axis. Cosine wave
is an even function.
• Odd function – The function that is not symmetrical about the y-axis. Sine wave
is an odd function.
The sum of the cosines is an even function. Contrast this with Fig (7), the sum of
sines, which is an odd function. These characteristics, odd and even, are useful when
looking at real and imaginary components of signals.
Now let’s allow the amplitude of each cosine wave to vary. Here is what one
particular sum of four cosines of unequal amplitudes looks like.
The coefficients bn allow us to vary the amplitude of each cosine wave. Putting this
equation to work, we see in the following figure the sum of four sine and four cosine
waves.
We are very close to completing our equation for arbitrary periodic waves. There is
only one remaining issue. Sums of sine and cosines are always symmetrical about the
x-axis so there is no possibility of representing a wave with a dc offset. To do that we
add a constant, a0 to the equation. This constant moves the whole wave up (or down)
along the y-axis offset.
N N
f (t ) = a0 + ∑ an sin(nω t ) + ∑ bn cos(nω t ) (4)
n =1 n =1
The coefficient a0 provides us with the needed dc offset from zero. Now with this
equation we can fully describe any periodic wave, no matter how complicated looking
it is. All arbitrary but periodic waves are composed of just plain and ordinary sines and
cosines and can de composed in its constituent frequencies..
Equation (4) is called the Fourier Series equation. The coefficients a0, an, and
bn are called the Fourier Series Coefficients.
There are several different ways to write the Fourier series. One common
representation is by linear frequency instead of the radial frequency. Replace ω by 2πf
and then write the equation as
N N
f (t ) = a0 + ∑ an sin( 2π nft ) + ∑ bn cos(2π nft ) (5)
n =1 n =1
1
f n (t ) = n f (t ) = n
T
f(t) the smallest frequency is called the resolution frequency, determines how
finely we decompose the signal. It can be any arbitrary number, say for example 2.35.
From that point on, the next harmonic is 2 times this, next one 3 times and so on. T, is
the period of the first wave we pick, and each fn is an integer multiple of the inverse of
that period. We can also start anywhere. We can pick a small resolution frequency and
then start the analysis with the 100th harmonic for example.
Replace fn by n/T, where T is the period and replace N by ∞ to write equation (5)
in a different from.
∞
f (t ) = a0 + ∑ an sin ( 2π t n / T ) + bn cos ( 2π tn / T ) (6)
n =1
We can also convert all sine waves and make them cosine waves by adding a half-
period phase shift. The cosine representation, used often in signal processing is written
by adding a phase term to the equation.
sin(2π ft ) = cos(2π ft + π / 2)
To create the f(t) we would add two cosine waves of the same frequency, except the
one of them would have a π / 2 phase shift (that’s a sine wave, really.) Now we have
only cosines. The name of the coefficient has been changed to cn, to reduce confusion
between this term and the terms an and bn. a0 and C0 would be exactly the same as a0.
∞
f (t ) = C0 + ∑ Cn cos(2π f n t + φn )
n =1
∞
f (t ) = C0 + ∑ Cn cos( wn t + φn )
n =1
(6a)
∞
2π n
f (t ) = C0 + ∑ Cn cos( t + φn )
n =1 T
∞
f (t ) = ∑
n =−∞
Cn e jnπ t / T (7)
All these different representations of the Fourier Series (4), (5), (6), (6a) and (7) are
identical and mean exactly the same thing.
Computing a0
∞
f (t ) = a0 + ∑ (an sin ωnt + bn cos ωn t )
n =1
The constant a0 in the Fourier equation above represents the dc offset. But before
we compute it, let’s take a look at one particular property of the sine and cosine waves.
Both sine and cosine wave are symmetrical about the x-axis. When you integrate a
sine or a cosine wave over one period, you will always get zero. The areas above the x-
axis cancels out the areas below it. This is always true over one period as we can see in
the figure below.
Positive and
negative area Positive and
cancel. negative area
cancel. +Area
+Area
+Area
-Area
-Area
Figure 14 - The area under a sine or a cosine wave over one period is always zero.
The same is also true of the sum of sine and cosines. Any wave made up of sum of
the sine and cosine waves also has zero area over one period. So we see that if we were
to integrate our signal over one period the area obtained will have to come from
coefficient a0 only. The harmonics can make no contribution and they fall out.
0
644444 4744444 48
T
T ∞
f (t )dt = ∫ ao dt + ∫ ∑ an sin wn t + bn cos wnt dt
T
∫
0
0 o
n =1
(8)
The second term is zero in (8), since it is just the integral of a wave made up of sine
and cosines. Now we can compute a0 by taking the integral of our complicated looking
wave over one period.
Figure 16 - Signal to be analyzed, looks like it has a dc offset since there is more area
above the x-axis than below.
∫
0
f (t )dt = ∫ ao dt
0
(9)
∫ f (t )dt = a T
0
0 (10)
Since no harmonics contribute to area, we see that a0 is equal to simply the area
under our complicated wave for one period divided by T, the integral period. We can
compute this area in software and if it is zero, then there is no dc offset. This is also the
mean value of the signal. A signal with zero mean value has no dc offset.
Computing an
Now we employ a slightly different trick from basic trigonometry to compute the
coefficients of the sine waves. Here is a sine wave of an arbitrary frequency nω that has
been multiplied by itself.
f (t ) = sin n ω t *sin n ω t
We notice that the resulting wave lies entirely above the x-axis and has a net
positive area. From integral tables we can compute the area as equal to
T
(12)
∫ an ( sin nωt ) ( sin mωt ) dt = anT / 2
0
for n = m
Where T is the period of the fundamental harmonic. But now let’s multiply the sine
wave by an arbitrary harmonic of itself to see what happens to the area.
f (t ) = sin n ω t *sin m ω t
Sine wave multiplied by
another of a different
harmonic
Figure 18 - The area under a sine wave multiplied by its own harmonic is always zero.
The area in one period of a sine wave multiplied by its own harmonic is zero. We
conclude that when we multiply a signal by a particular harmonic, the only contribution
comes from that particular harmonic. All others harmonics contribute nothing and fall
out.
(12)
T
Now let’s multiply a sine wave by a cosine wave to see what happens.
f (t ) = sin nω t *cos mω t
Sine wave multiplied by a
cosine wave for any n and m
Figure 19 - The area under a cosine wave multiplied by a sine wave is always zero.
It seems that the area under the wave which is multiplication of a sine and cosine
wave is always zero whether the harmonics are the same or not. Summarizing, by
setting ωn = nω
∫ a ( sin ω t ) ( sin ω t ) dt = 0
0
n n m for n ≠ m
∫ a ( sin ω t ) ( sin ω t ) dt = a T / 2
0
n n m n for n = m (13)
∫ a ( cos ω t ) ( sin ω t ) dt = 0
0
n n m for all n and m
Rules:
2. The area under one period of a wave that is a product of two sine or cosine
waves of non-harmonic frequencies is zero.
4. The area under one period of a wave that is a product of a sine wave and a
cosine wave of any frequencies (different or equal) is equal to zero.
Recall that in vector representation, sine and cosines are orthogonal to each other.
So all harmonics are by definition orthogonal to each other.
A very satisfying interpretation of the above rules is that sine and cosine waves can
act as filtering signals. In essence they act as narrow-band filters and take out all
frequencies except the one of interest. This forms the basic concept of a filter.
Now let’s use this information. Successively multiply the Fourier equation by a sine
wave of a particular harmonic and integrate over one period as in equation below.
0 0
644744
8 64444744448
T T T T
We know that the integral of the first and the third term is zero since the first term
is the integral of a sine wave multiplied by a constant (Rule 1) and the third is a sine
wave multiplied by a cosine wave (Rule 3). This simplifies our equation considerably.
The integral of the second term is
T
anT
∫a n sin ( nω t ) sin ( nω t ) dt = (13)
0
2
From this we write the equation to obtain an, which are the coefficients of each of
the sine waves as follows
T
2
f (t ) sin ( n ω t ) dt
T ∫0
an = (14)
The an is then computed by taking the signal over one period, successively
multiplying it with a sine wave of n times the starting fundamental frequency and then
integrating. This gives the coefficient for that particular harmonic.
Imagine we have a signal that consists of just one frequency, we think it is around 5
Hz (and is a sine wave from). We begin by multiplying this signal by a sine wave of
frequency .2 and each of its harmonics which are .4, .6, .8 ,…..10 and so on. Actually
Easy Fourier Analysis Part 1 Complextoreal.com 16
since we know it is in the range of 5 Hz, we can dispense with the lower harmonics say
up to 4 and start with 4.2 and go to 5.8 Hz.
1. Multiple the wave with a sine wave of frequencies 4.2 and integrate the result.
Most likely the result will be zero.
2. Go to next harmonic, which 4.4. This is 22nd harmonic of the resolution
frequency .2 Hz.
3. Repeat step 1 and 2 and continue until harmonic frequency is equal to 5.8 Hz.
The results will show that the integrals of all harmonics frequencies are zero, except
for the 25th harmonic, the integral of which will be equal to
a25T
= = 2.5a25
2
One period integral
a25 =
2.5
Where T = 1/f = 1/.2 = 5 sec. The coefficient can now be calculated which gives the
amplitude of the wave. (We already know its frequency, which is 5 Hz, since the
integral is non-zero for that component.).
0 0
6447448 64444
4744444
8
T T T T
Now terms 1 and 2 become zero. (First term is zero from rule 1, the second term
due to rule 3.) The third terms is equal to
T
bnT
∫b n cos ( nωt ) cos ( nωt ) dt = (14)
0
2
Without going through the math, we will give the answers in two vectors, first is the
coefficients of the sine and second the cosine waves and the dcoffset.
an = [.4 .3 .7 .3 .3 .3 .2 .3 .4]
a0 = .32
The coefficients are the amplitudes of each of the harmonics. The resolution
frequency is 1 Hz and the harmonics are integer multiples of this frequency. Now we
know exactly what the components of the received wave are. If the transmitted wave
consisted only of one of these frequencies, then, we can filter this wave and get back
the transmitted signal.
Easy Fourier Analysis Part 1 Complextoreal.com 18
Summary
∞ ∞
f (t ) = a0 + ∑ an sin(ωnt ) + ∑ bn cos(ωnt )
n =1 n =1
where
ωn = 2π nf
T
1
a0 =
T ∫ f (t )dt
0
T
2
f (t ) sin ( nω t ) dt
T ∫0
an =
T
2
bn = ∫ f (t ) cos ( nω t ) dt
T 0
n
ωn = 2π f n = 2π
T
Now that we have the coefficients, we can plot the magnitude spectrum of the
signal.
You may now say that this spectrum is in terms of sines and cosines, and this is not
the way we see it in books. The spectrum ought to give just one number for each
frequency.
We can compute that one number by knowing that most signal are represented in
complex notation where sine and cosine waves are related in quadrature. The total
power shown on the y axis of the spectrum is the power in both the sine and cosine
waves in the real and imaginary components of the same frequency. We can compute
the magnitude by from the root sum square of the sine and cosine coefficients for each
harmonic including the dc offset of the zero frequency value.
1.20
1.00
Magnitude
0.80
Magnitude
0.60
0.40
0.20
0.00
Frequency
Voila! Although this is not a real signal, we see that it now looks like a traditional
spectrum. The largest component is at frequency = 3. The y-axis can easily be
converted to dB. In complex representation, the phase of the signal is defined by
φ n = tan −1 ( bn / a n )
For every frequency, we can also compute and plot the phase. Phase plays a very
important role in signal processing and particularly in complex representation and
shows useful information about the signal.
One thing you may not have noticed during this computation of the coefficients is
that they will be different depending on what you pick as the resolution frequency. We
will get different answers depending on the choice we make for this number. In essence
depending on the resolution, the signal energy leaks from one frequency to the next so
we get different answers, but the overall picture remains the same. The issues of
leakage will discussed later.
We also stated that the wave has to be periodic. But for real signals we can never
tell where the period is. Random signals do not have discernible periods. In fact, a real
signal may not be periodic at all. In this case, the theory allows us to extend the
“period” to infinity so we just pick any representative section of our signal or even the
whole signal and call it “The Period”. Mathematically this assumption works out just
fine for real signals.
Figure 23 - We call the signal periodic, even though we don’t know what lies at
each end.
I can be reached at
mntcastle@earthlink.net
Other tutorials at
www.complextoreal.com
Bertrand Russell called this equation “the most beautiful, profound and subtle expression
in mathematics.”. Richard Feyman., the noble laureate said that it is “the most amazing
equation in all of mathematics”. In electrical engineering, this enigmatic equation is
equivalent in importance to F = ma.
This perplexing looking equation was first developed by Euler (pronounced Oiler) in the
early1800’s. A student of Johann Bernoulli, Euler was the foremost scientist of his day.
Born in Switzerland, he spent his later years at the University of St. Petersburg in Russia.
He perfected plane and solid geometry, created the first comprehensive approach to
complex numbers and is the father of modern calculus. He was the first to introduce the
concept of log x and ex as a function and it was his efforts that made the use of e, i and pi
the common language of mathematics. He derived the equation ex + 1 = 0 and its more
general form given above. Among his other contributions were the consistent use of the
sin, cos functions and the use of symbols for summation. A father of 13, he was a prolific
man in all aspects, in languages, medicine, botany, geography and all physical sciences.
ejwt in Euler’s equation is a decidedly confusing concept. What exactly is the role
of j in ejwt? We know that it stands for −1 but what is it doing here? Can we visualize
this function?
Take any real number, say 3, and plot it on a X-Y plot as in Fig 1a. Multiply this
number by j, so it becomes 3j. Where do we plot it now? Herein lies our answer to what
multiplication with j does.
3j
3i
X
Phase shift due to -3 3
multiplication with j
X
3 -3j
The number stays exactly the same, 3j is the same as 3, except that multiplication
with j shifts the phase of this number by +90o. So instead of an X-axis number, it
becomes a Y-axis number. Each subsequent multiplication rotates it further by 90o in the
X-Y plane as shown in Figure 1b. 3 become 3j, then -3 and then -3j and back to 3 doing
a complete 360 degree turn. Division by j means the opposite. It shifts the phase by -90o.
(Question: What does division by -j mean?)
To further complicate matters, the axes, which were called X and Y in our
Cartesian mathematics are now called respectively Real and Imaginary. Why so? Is the
quantity 3j any less real than 3?
3 3+j3 ejwt
sin wt
X X
3 cos wt
Now let’s plot a complex number, 3 + j3. In Cartesian math we would write this
number as (3,3) indicating 3 units on the X-axis and 3 units in the Y-axis. Similarly, the
real quantity is plotted on the X-axis (real part) and the j coefficient (imaginary part) is
plotted on the Y-axis. These are the X-Y projections of this number. The projection
magnitudes are real and not encumbered by the vexing j.
A complex number can have for its coefficients, instead of numbers, equations
(cos x, sin x). We plot these in exactly the same way as shown in Figure 2b except that X
and Y projections instead of being numbers, are functions, namely sine and cosine in this
case.
Now let’s take a look at the ejwt again. It is called a Cisoid {(cos x + j sin x)usoid} from
contraction of the parts of the Euler’s equation.
Now forget about the ejwt part and concentrate only on the RHS containing sines
and cosines.
We plot this function by setting the X-axis = cos wt and the Y-axis = sin wt. This
plot is shown in Figure 3.
Imaginary Axis
sin wt
cos wt Time
Real Axis
In Figure 3 cos wt is plotted on the Real axis and sin wt is plotted on the
Imaginary axis. The function looks like a helix moving forward in time to the right. The
X-Z and the Y-Z projections, if plotted, would be the sine and cosine functions.
Had we plotted the function e-jwt, we would have seen that it moves to the left
instead of to the right. This direction of rotation has important implications for the
definition of frequency.
Now let’s express sines and cosines in terms of our new quantity ejwt. So we have
e jwt − e − jwt
sin wt =
2j (3)
e jwt + e − jwt
cos wt =
2
Now let’s just substitute Q+, for ejwt and Q- for e-jwt , we get
Q+ + Q−
cos wt =
2 (4)
Q − Q−
sin wt = +
2j
The use of Q is just to make it easier to see what is happening. We have redefined
sine as a difference between two phasors Q+ and Q- and cosine as the sum of the same of
the same two phasors. The presence of j in the definition of sine means that it is -90o to
the other term and nothing more. So mentally erase the j in the denominator, if it bothers
you.
Y
2sinwt = ejwt - e-jwt
e-jwt ejwt
Q- Q+ Phasor Q+ rotates
counterclockwise
with time
X
Phasor Q- rotates
clockwise
with time 2coswt = ejwt + e-jwt
Imaginary Imaginary
2 sinwt = 2/sqrt(2)
ejwt
1
2 sinwt = 0 1 ejwt 2
Real
2 cos wt = 2 Real 2 coswt = 2/sqrt(2)
1 e-jwt
1
e-jwt
At t = 0, both phasors are horizontal. Their vector sum is twice the length of each.
So cos wt = 1 and since the difference is zero, sin wt = 0
At t = pi/4, the Q- phasor has rotated up to pi/4 and the Q- phasor has rotated to -
pi/4. Now their vector sums, give us cos wt = 1/sqrt 2 and their difference gives also
1/sqrt2.
3. wt = π/2 4. wt = 3π/4
Imaginary Imaginary
ejwt At wt = -3pi/4
ejwt
2 sinwt = 2
Real Real
2 coswt = -2/sqrt(2)
2 cos wt = 0
2 sinwt = 2/sqrt(2)
e-jwt
e-jwt
At t = pi/2, Q+ phasor has rotated upright and the Q- has rotated down to the
opposite side. Now the vector sum gives us the cos wt = 0 and sin wt = 1.
Imaginary
5. wt = π
ejwt
Real
-2 cos wt = -2 e-jwt 2 sin wt = 0
At wt = pi/2, the phasors meet again. The sine term which is the difference is once
again zero and the cosine term is the sum of the two magnitudes and as such cos wt = 1
and sin wt =0.
By following each phasor we see that at every t, we get the conventional and
correct values of sine and cosines.
Now we make the following important points that will help us in dealing with concepts of
negative frequency and signals in quadrature.
If we think about sine and cosines strictly in terms of phasors and forget about the
old trigonometric definition of sine in terms of frequency and amplitude, we can talk
about (but using old terminology) the concept of negative frequency.
The difficulty is that frequency is really a two dimensional concept but is often
seen only as one. Two dimensions are needed to describe a frequency, its cycles per
second and its direction of rotation. Historically we have always talked of frequency as a
physical quality of a wave. Spectrum analyzers and other electrical measuring devices are
one dimensional as well which limits our understanding of the general concept of
frequency.
The general concept of frequency can be written as follows
dφ
f =
dt
We can define frequency as the rate of change of phase over time. So a + 2π rotation
over half second means the frequency is 2. And here we see that if phase rotates around
counter-clockwise, then we have the definition of positive frequency and when it goes the
other way then it is negative. A - 2π rotation over half second means the frequency is -2.
Velocity or speed which we also tend to think of as a scalar has a similar confusing
aspect. We can talk about 60 miles per hour and this makes perfect sense. But what does
–60 miles per hour mean? Mathematically it is a perfectly OK construct. It just means
same speed but going backwards. The concept of negative frequency is just as simple as
that.
Figure below shows the effect of this multiplication. Figure 8a shows the
Amplitude spectrum centered about frequency = 2. Multiplying this signal by e j ( 2πf ) t
where f = 2 causes the spectrum of the new signal to shift to 4 for a total shift of f = 2.
When we multiply this signal by e j ( 2πf ) t where f = -2 causes the spectrum of the new
signal to shift to 0 for a total shift of f = -2 as in Figure 8c.
0 1 2 3 Frequency
We can draw the Fourier transform of this signal easily by examining the amplitudes of each of these frequencies
and then putting one-half on each side of the y-axis as shown in Fig. 2 for a two sided spectrum. Real signals such
as this one produce only one sided spectrums also shown below.
G(f)
G(f)
1
1/2
1/6 1/3
1/10 1/5
f f
Figure 2 - The two-sided and single-sided Fourier Transform of g(t)
This is the theoretical Fourier Transform of the continuos waveform g(t). The Fourier Transform tells us that there
are just three frequencies in the signal and no others. There is no ambiguity in the results. This ideal Fourier
Transform is what we want to see when do the Fourier Transform on a analyzer or on a computer but in reality
this is nearly impossible to obtain. All implementations of the Fourier Transform are attempts to achieve the
theoretical results, however, digital signal processing introduces approximations and truncation effects which
keep us from realizing the ideal.
Figure 3 shows the outline of the same signal along with dots that represents what we actually see of the
signal on a oscilloscope. This is because most signals we capture are sampled versions of the real analog signal.
We pulse the analog signal every so often and then plot these sampled values. We connect the samples and get a
proxy to the signal.
http://complextoreal.com/fft3.htm 5/4/2006
Here is a wave Page 2 of 20
Figure 3 - The discrete samples of a real signal as shown by dots. We really do not know the underlying shape of the
signal.
Mathematically, the sampled signal is obtained by multiplying the target signal with an impulse train of
period τ. Since we usually collect only a limited number of samples we limit the length of the impulse train to a
certain time window. The discrete signal is expressed as
g ( k τ ) = g ( t )δ ( t − kτ )
So before we can even look at a signal, two things have happened. 1. we have multiplied the target signal
by an impulse train and made the continuos signal a discrete signal and 2. we have chosen to collect only a limited
number of samples, in effect windowing the sequence with a rectangular window function.
Fig 4a shows the original signal and its Fourier Transform. In (b) we have the Fourier Transform of a
pulse train which is used for sampling the original signal. The Fourier transform of the impulse train consists of
just one frequency, the sampling frequency.
Next step is the rectangular window that limits the infinite impulse train. Its Fourier Transform is shown
in c and is the well-known sinc function.
g ( kτ ) = g ( t ) δ ( t − kτ ) u( t ) for t < T
1 2 3
The first is the original signal, the second is the impulse train of period τ and the third is a step function
lasting for time T. What about the Fourier Transform of the product of these three signals? Mathematically we
know that multiplication in time domain of two signals results in convolution of their spectrums in the frequency
domain. So we have an inkling that the convolution of all three of the Fourier Transforms may not give us the
spectrum in (a). But is it close enough to (a), and if not how different is it?
http://complextoreal.com/fft3.htm 5/4/2006
Here is a wave Page 3 of 20
g(t) (a)
t f
(b)
fs(t) t -fs fs f
g(t)
Limiting window W(f)
(c)
w(t) f
?
(d)
g(kτ) t f
Sampling frequency: fs
Sampling frequency is a measure of how often we pulse the continuos signal to obtain the samples. The
quantity sampled is the amplitude of the signal.
Sample Time: τ
Τime between each sample. It is also the inverse of the sampling frequency.
If sampling frequency, fs = 20 samples/sec, then
http://complextoreal.com/fft3.htm 5/4/2006
Here is a wave Page 4 of 20
This the time length of the collected sequence and is equal to the product of the sample time and the total
number of samples.
=Nτ
Sample index: k
The sequence time is no longer continuos so instead of t, we use a discrete time measure called kth sample. This is
an index of the samples. Its range extends from 0 to N-1, where N is the last sample. Each kth sample of total N
samples, is located at time k times τ secs.
Kth
τ τ τ τ τ τ τ
0 1 2 3 4 . k N-1
In a continuos signal we refer to a particular point at its instantaneous value of t. For discrete signals, We
refer to any particular sample as g(kτ). So each sample differs in time from the previous one by τ secs. For
example the 3rd sample similarly is located at (3 x .05) = .15 secs and the 10th sample is located at time (10 x .05)
= .5 secs..
g(t) = g(k τ)
Harmonic index: n
Frequencies that are integer multiple of a fundamental frequency are referred to as harmonics of that
fundamental frequency. In computing DFT, we use the concepts of harmonics in a special way.
From the sampling theorem, we know if we want to recreate a signal from its samples then we must
collect at least twice its frequency number of samples per second. This also says that we can detect frequencies in
a signal only up to one half of its sampling frequency. So the values of n ranges from
fs f
n ≤ s
N 2
N
or n ≤
2
This says that we can only detect half as many harmonics as the total number of samples. However the
index itself goes from -(N-1) to +(N-1) and spans both sides of the spectrum reflecting the positive and negative
components of the frequency.
http://complextoreal.com/fft3.htm 5/4/2006
Here is a wave Page 5 of 20
+∞
G( f ) = ∫ g( t ) e − j ω t dt -1-
−∞
The above equation says that if we multiply the target signal by a complex sinusoid of harmonic frequencies 1, 2,
3, ..n one at a time and then integrate the results, the integration yields the amplitude of the nth harmonic. Why?
Because multiplication by the sinusoid acts as filter for all other frequencies. (Refer to Fourier Transform
Tutorials No. 1 and 2). The objective is to compute the complex coefficients cn, which when plotted give us the
frequency content of the signal.
+∞
a n = ∫ g( t )sin( nω t )dt = amplitude of the n harmonic sine wave
−∞ th
+∞
bn = ∫ g( t ) cos( nω t )dt = amplitude of the n harmonic cosine wave
−∞ th
The integration limits in the Fourier transform formula of Eq. 1 go from - ∞ in to + ∞ in. What does that mean
for our sampled sequence of N samples?
Fourier Transform also requires that the signal be periodic. But looking at only N samples we can not tell if the
samples cover one exact period, more than one or less than one period. In order to do the Fourier Transform, we
need at least one whole period or the result is suspect.
We already see some problems as we go from continuous to discrete processing, The problems are
Let’s continue despite the fact that we don’t know if what we are about to do is right. We are going to assume that
these two things will not cause us much trouble and the results will be acceptable.
Now let’s change time from continuos to discrete by making the following substitutions for time and frequency.
g(t) = g(k τ)
ω n = 2π f n
Equation 1 becomes
N −1
G( f n ) = ∑ g( kτ ) e − j( 2π f n )( kτ )
k =0 -2-
http://complextoreal.com/fft3.htm 5/4/2006
Here is a wave Page 6 of 20
We have also changed the integral to summation to note the change from continuous to discrete as two processes
are equivalent in the two domains.
By applying the Fourier Transform algorithm on these N samples, we have made an implicit assumption. We have
assumed that the signal is periodic over N samples, so we have assumed that the fundamental frequency of our
signal is equal to the inverse of time T of the N samples. We express the fundamental frequency as
1
f0 =
T
We can rewrite T as a function of sample time, τ and total number of samples chosen, N to alternately express the
fundamental frequency in terms of fs and N.
1 1
f0 = =
τN sec s
x Total no. of sample
sample
fs
f0 =
N
This is a very important concept to understand. It says that you have artificially set the fundamental frequency to
the sampling frequency divided by the total number of samples observed. It is a strange idea seemingly having
nothing to do with the target signal and in fact this is true.
This frequency referred to as the fundamental frequency of the signal really is kind of a resolution frequency and
has nothing to do with the target signal. It just means that we resolve the target signal components in integer
multiples of this resolution frequency.
Let’s say that we sampled the above signal at sample time of 1/20th sec and observed 60 samples. Then the
fundamental frequency is
fs 20
f0 = = = .333 Hz
N 60
Now when we compute the Fourier Transform we will be stepping this fundamental frequency by integer
multiples. With f0 = .333, the next harmonic would be f1 = .666 and so on. The harmonics used in the analysis are
not integers but integer multiple of the fundamental frequency of the signal as determined by the sampling
frequency and the N samples observed. An alternate way to see these harmonics is see them as bins which collect
energy. In DFT they are also called cells.
fn = n f0
http://complextoreal.com/fft3.htm 5/4/2006
Here is a wave Page 7 of 20
n n fs
fn = =
τN N
Now we rewrite the Fourier Transform substituting above expression for fn in Eq. 2.
n
N −1 − j ( 2π )( kτ )
G( f n ) = ∑ g ( kτ ) e τN
k =0
N −1
⎛ n ⎞ − j 2π n k
G⎜ ⎟=
⎝τ N ⎠
∑ g( kτ ) e N
k =0
N −1
⎛ n ⎞ 1 − j 2π n k
G⎜ ⎟=
⎝τ N ⎠ N
∑ g( kτ ) e
N
k =0 -3-
The above form of the Fourier Transform is called the Discrete Fourier Transform (DFT). The Division by N is
used to normalize the values.
DFT is a special case of the Fourier Transform and is actually an approximation of the real thing. The validity of
the approximation is effected by the type of waveform we are dealing with as well as the parameters fs and N.
The process of computing the DFT is identical to computing the Fourier coefficients we did in Tutorial 1.
1. What is the sampling frequency of the target signal? Is the sampling frequency large enough so that it covers all
significant frequencies in the signal?
2. How many samples do we need?
First compute the fundamental frequency, and starting with the fundamental frequency we multiply the discrete
signal by a complex exponential and perform summation on the result.
Do you recall what it means to multiply by a complex exponential? How do you interpret the following equation?
f ( t ) e − j 2πft
http://complextoreal.com/fft3.htm 5/4/2006
Here is a wave Page 8 of 20
cos(2 π ft)
f(t)
sin(2 π ft)
The signal in fact is being split into two parts, 1. multiplied by a sine wave and the other by a cosine of the same
frequency. The resulting two signals are orthogonal and are the result of multiplication with the complex
exponential or phasor.
Step 1 - Multiply the target signal in 7a by a cosine wave in 7b of frequency f0. For this demonstration, we
assume that f0 = 1. (Although only cosines are shown, we do this for both sines and cosines and keep track of the
results separately.)
http://complextoreal.com/fft3.htm 5/4/2006
Here is a wave Page 9 of 20
Figure 7c - result of multiplying the first harmonic with the target signal. The waveform has positive area.
The multiplication gives us the waveform in 7cNow integrate this waveform over the N samples. In a discrete
case, we integrate by multiplying the sample amplitude by the width of the base which is equal to τ, the sample
time, using the trapezoidal rule. We are in effect adding up the areas of all the small gray rectangles in Figure 7c.
Each sample value is multiplied by τ and these areas are summed.
The result of the multiplication tells us something interesting. We see that the resulting waveform is not even, so
it has net area under it. This means that there is a signal hiding in this frequency. What is the amplitude of this
frequency? That we know only when we complete the summation. The result of the summation gives us the
amplitude of this harmonic in the target signal.
Step 2: Now multiply the Signal in 7a with the second harmonic as shown in Figure 7d. The multiplication gives
the waveform in Figure 7e.
Figure 7e - Result of multiplying the 2nd harmonic with the target signal. The waveform has no area.
The waveform of 7e is even, which means that the summation of the little gray rectangles will give zero area.
Since it has no net area means there is nothing of interest here.
Let’s go to the next harmonic. Now multiply the target signal with the 3rd harmonic as in Fig 7f. The resulting
waveform is shown in Fig 7g.
http://complextoreal.com/fft3.htm 5/4/2006