Page 1
Fourier Analysis
Fourier analysis follows from Fourier’s theorem, which states that every function
can be completely expressed as a sum of sines and cosines of various amplitudes and
frequencies. This is a pretty impressive assertion – no matter what the shape of a
function, and how little it looks like a sine wave, it can be rewritten as a sum of sines and
cosines. The Fourier series tells you the amplitude and frequency of the sines and
cosines that you should add up to recreate your original function.
Before getting into the details of Fourier series, it may help to briefly review the
terms associated with a sine wave with the figure below.
A cosine wave is just a sine wave shifted in phase by 90
o
(f=90
o
).
Cosine functions are even functions while sine wave are odd functions. An even
function is symmetric with respect to the y-axis, meaning that its graph remains
unchanged after reflection about the y-axis. On the other hand, an odd function is
symmetric with respect to the origin, meaning that its graph remains unchanged after
rotation of 180 degrees about the origin.
In the language of linear algebra, Fourier’s theorem states that sine waves and
cosine wave create a complete basis set that spans all possible functions. Sines and
cosines are in fact independent (and also orthogonal) -- there is no way to add up cosine
waves to create a sine wave.
A nice example of Fourier’s Theorem is the creation of a square wave by
summing the appropriate component sine waves. Like a sine or a cosine wave, a square
A = amplitude
f = phase (offset)
) 2 sin( ) ( ? p? + = t A t f
A
1/?
f
? = frequency
1/? = period = 1/frequency
f
t
degrees
Page 2
Fourier Analysis
Fourier analysis follows from Fourier’s theorem, which states that every function
can be completely expressed as a sum of sines and cosines of various amplitudes and
frequencies. This is a pretty impressive assertion – no matter what the shape of a
function, and how little it looks like a sine wave, it can be rewritten as a sum of sines and
cosines. The Fourier series tells you the amplitude and frequency of the sines and
cosines that you should add up to recreate your original function.
Before getting into the details of Fourier series, it may help to briefly review the
terms associated with a sine wave with the figure below.
A cosine wave is just a sine wave shifted in phase by 90
o
(f=90
o
).
Cosine functions are even functions while sine wave are odd functions. An even
function is symmetric with respect to the y-axis, meaning that its graph remains
unchanged after reflection about the y-axis. On the other hand, an odd function is
symmetric with respect to the origin, meaning that its graph remains unchanged after
rotation of 180 degrees about the origin.
In the language of linear algebra, Fourier’s theorem states that sine waves and
cosine wave create a complete basis set that spans all possible functions. Sines and
cosines are in fact independent (and also orthogonal) -- there is no way to add up cosine
waves to create a sine wave.
A nice example of Fourier’s Theorem is the creation of a square wave by
summing the appropriate component sine waves. Like a sine or a cosine wave, a square
A = amplitude
f = phase (offset)
) 2 sin( ) ( ? p? + = t A t f
A
1/?
f
? = frequency
1/? = period = 1/frequency
f
t
degrees
wave is a periodic function. Unlike those other functions, a square wave has sharp
corners at 90
o
angles (see figure below).
SQUARE WAVE
How could we create a square wave out of sines and cosines? In the figure below,
the top panels represents a waveform and the bottom panel represents the sine waves that
are added together to form the waveform. Each column contains one more component
sine wave than the previous panel. As you can see, as you add up more sine waves, the
resulting waveform starts to look more and more like a square wave. An infinite sum of
the appropriately chosen sine waves would lead to a perfect square wave.
summed
waveform
component
sine waves
How did I know which sine wave should be summed to create the square wave?
The Fourier series is used to figure out which sine and cosine waves should be summed,
at what amplitude, to create a periodic waveform of interest. This is the Fourier series for
a square wave:
?
8
=
+
+
=
+ + + + =
0
1 2
) 1 2 sin(
...
7
7 sin
5
5 sin
3
3 sin
sin ) (
k
k
x k
x x x
x x square
p
p p p
p
Notice that only sines, and not cosines, contribute to creating the square wave.
That’s because the square wave that I’ve drawn is an odd function, just like a sine wave.
If we shifted the square wave by 90
o
, we would have summed cosines to create it instead.
Once we know the Fourier series for a square wave, the square wave can easily be
expressed in the frequency domain. This involves plotting the amplitude or the power
spectrum. The amplitude spectrum is just the amplitude of the sine/cosine at each
Page 3
Fourier Analysis
Fourier analysis follows from Fourier’s theorem, which states that every function
can be completely expressed as a sum of sines and cosines of various amplitudes and
frequencies. This is a pretty impressive assertion – no matter what the shape of a
function, and how little it looks like a sine wave, it can be rewritten as a sum of sines and
cosines. The Fourier series tells you the amplitude and frequency of the sines and
cosines that you should add up to recreate your original function.
Before getting into the details of Fourier series, it may help to briefly review the
terms associated with a sine wave with the figure below.
A cosine wave is just a sine wave shifted in phase by 90
o
(f=90
o
).
Cosine functions are even functions while sine wave are odd functions. An even
function is symmetric with respect to the y-axis, meaning that its graph remains
unchanged after reflection about the y-axis. On the other hand, an odd function is
symmetric with respect to the origin, meaning that its graph remains unchanged after
rotation of 180 degrees about the origin.
In the language of linear algebra, Fourier’s theorem states that sine waves and
cosine wave create a complete basis set that spans all possible functions. Sines and
cosines are in fact independent (and also orthogonal) -- there is no way to add up cosine
waves to create a sine wave.
A nice example of Fourier’s Theorem is the creation of a square wave by
summing the appropriate component sine waves. Like a sine or a cosine wave, a square
A = amplitude
f = phase (offset)
) 2 sin( ) ( ? p? + = t A t f
A
1/?
f
? = frequency
1/? = period = 1/frequency
f
t
degrees
wave is a periodic function. Unlike those other functions, a square wave has sharp
corners at 90
o
angles (see figure below).
SQUARE WAVE
How could we create a square wave out of sines and cosines? In the figure below,
the top panels represents a waveform and the bottom panel represents the sine waves that
are added together to form the waveform. Each column contains one more component
sine wave than the previous panel. As you can see, as you add up more sine waves, the
resulting waveform starts to look more and more like a square wave. An infinite sum of
the appropriately chosen sine waves would lead to a perfect square wave.
summed
waveform
component
sine waves
How did I know which sine wave should be summed to create the square wave?
The Fourier series is used to figure out which sine and cosine waves should be summed,
at what amplitude, to create a periodic waveform of interest. This is the Fourier series for
a square wave:
?
8
=
+
+
=
+ + + + =
0
1 2
) 1 2 sin(
...
7
7 sin
5
5 sin
3
3 sin
sin ) (
k
k
x k
x x x
x x square
p
p p p
p
Notice that only sines, and not cosines, contribute to creating the square wave.
That’s because the square wave that I’ve drawn is an odd function, just like a sine wave.
If we shifted the square wave by 90
o
, we would have summed cosines to create it instead.
Once we know the Fourier series for a square wave, the square wave can easily be
expressed in the frequency domain. This involves plotting the amplitude or the power
spectrum. The amplitude spectrum is just the amplitude of the sine/cosine at each
frequency, while the power spectrum is the square of the amplitude spectrum. Based on
the equation for the square wave above, the amplitude is 1 for frequency of 1 (?=1), 1/3
for frequency of 3 (?=3), and so on. The amplitude/power is zero at even frequencies for
this square wave example.
The figure below is another simple example of plotting the same signal in both the
time domain and frequency domain. The sine waves represented by the top two rows are
summed to create the waveform in the bottom row. The right column shows how much
power is in each frequency (“power spectrum”). Notice that the power is zero at most
frequencies. This is because the waveforms in this example are composed of either 1 or 2
sine waves, so most frequencies are not contributing any power to the signal.
The extension of a Fourier series for a non-periodic function is known as the
Fourier transform. When calculating the Fourier transform, rather than decomposing a
signal in terms of sines and cosines, people often use complex exponentials. They can be
a little easier to interpret, although they are mathematically equivalent. A complex
exponential is defined as Ae
if
, where i
2
=-1 (i is the “imaginary” number), A is the
amplitude, and f is the phase. A waveform can be decomposed in terms of complex
exponentials rather than sines and cosines because of Euler’s Theorem, which highlights
the surprisingly close relationship between a complex exponential and sines/cosines.
EULER’S THEOREM:
f f
f
sin cos i e
i
+ =
Page 4
Fourier Analysis
Fourier analysis follows from Fourier’s theorem, which states that every function
can be completely expressed as a sum of sines and cosines of various amplitudes and
frequencies. This is a pretty impressive assertion – no matter what the shape of a
function, and how little it looks like a sine wave, it can be rewritten as a sum of sines and
cosines. The Fourier series tells you the amplitude and frequency of the sines and
cosines that you should add up to recreate your original function.
Before getting into the details of Fourier series, it may help to briefly review the
terms associated with a sine wave with the figure below.
A cosine wave is just a sine wave shifted in phase by 90
o
(f=90
o
).
Cosine functions are even functions while sine wave are odd functions. An even
function is symmetric with respect to the y-axis, meaning that its graph remains
unchanged after reflection about the y-axis. On the other hand, an odd function is
symmetric with respect to the origin, meaning that its graph remains unchanged after
rotation of 180 degrees about the origin.
In the language of linear algebra, Fourier’s theorem states that sine waves and
cosine wave create a complete basis set that spans all possible functions. Sines and
cosines are in fact independent (and also orthogonal) -- there is no way to add up cosine
waves to create a sine wave.
A nice example of Fourier’s Theorem is the creation of a square wave by
summing the appropriate component sine waves. Like a sine or a cosine wave, a square
A = amplitude
f = phase (offset)
) 2 sin( ) ( ? p? + = t A t f
A
1/?
f
? = frequency
1/? = period = 1/frequency
f
t
degrees
wave is a periodic function. Unlike those other functions, a square wave has sharp
corners at 90
o
angles (see figure below).
SQUARE WAVE
How could we create a square wave out of sines and cosines? In the figure below,
the top panels represents a waveform and the bottom panel represents the sine waves that
are added together to form the waveform. Each column contains one more component
sine wave than the previous panel. As you can see, as you add up more sine waves, the
resulting waveform starts to look more and more like a square wave. An infinite sum of
the appropriately chosen sine waves would lead to a perfect square wave.
summed
waveform
component
sine waves
How did I know which sine wave should be summed to create the square wave?
The Fourier series is used to figure out which sine and cosine waves should be summed,
at what amplitude, to create a periodic waveform of interest. This is the Fourier series for
a square wave:
?
8
=
+
+
=
+ + + + =
0
1 2
) 1 2 sin(
...
7
7 sin
5
5 sin
3
3 sin
sin ) (
k
k
x k
x x x
x x square
p
p p p
p
Notice that only sines, and not cosines, contribute to creating the square wave.
That’s because the square wave that I’ve drawn is an odd function, just like a sine wave.
If we shifted the square wave by 90
o
, we would have summed cosines to create it instead.
Once we know the Fourier series for a square wave, the square wave can easily be
expressed in the frequency domain. This involves plotting the amplitude or the power
spectrum. The amplitude spectrum is just the amplitude of the sine/cosine at each
frequency, while the power spectrum is the square of the amplitude spectrum. Based on
the equation for the square wave above, the amplitude is 1 for frequency of 1 (?=1), 1/3
for frequency of 3 (?=3), and so on. The amplitude/power is zero at even frequencies for
this square wave example.
The figure below is another simple example of plotting the same signal in both the
time domain and frequency domain. The sine waves represented by the top two rows are
summed to create the waveform in the bottom row. The right column shows how much
power is in each frequency (“power spectrum”). Notice that the power is zero at most
frequencies. This is because the waveforms in this example are composed of either 1 or 2
sine waves, so most frequencies are not contributing any power to the signal.
The extension of a Fourier series for a non-periodic function is known as the
Fourier transform. When calculating the Fourier transform, rather than decomposing a
signal in terms of sines and cosines, people often use complex exponentials. They can be
a little easier to interpret, although they are mathematically equivalent. A complex
exponential is defined as Ae
if
, where i
2
=-1 (i is the “imaginary” number), A is the
amplitude, and f is the phase. A waveform can be decomposed in terms of complex
exponentials rather than sines and cosines because of Euler’s Theorem, which highlights
the surprisingly close relationship between a complex exponential and sines/cosines.
EULER’S THEOREM:
f f
f
sin cos i e
i
+ =
The Fourier transform allows you to write any function (f(t)) as the integral (sum)
across frequencies of complex exponentials of different amplitudes and phases (F(?)).
f(t) is often called the “time domain” representation while F(?) is called the “frequency
domain representation.” The key thing to understand about Fourier transforms is that
these two representations are different ways of expressing the same information. The
formula for a Fourier transform is below:
) (
) ( ) (
) (
2
1
) (
? f
?
? ?
? ?
p
i
t i
e A F
d e F t f
=
=
?
8
8 -
When you use a computer to take a Fourier transform of a function f(t), the
computer will return the complex number F(?), which you should think of as a vector in
the complex plane, as plotted below. The complex plane is a 2-D plane with real
numbers along the x-axis and imaginary numbers along the y-axis.
a(?)
b(?)
F(?)=
a(?)+ib(?)
Real
Imaginary
The easiest way to interpret F(?) is by calculating the amplitude (A) and the
phase (f) at each frequency. The amplitude (or “magnitude”) tells you how much signal
there is at a given frequency, whereas the phase tells you the delay of the signal at a given
frequency. Based on the geometric interpretation of a complex exponential, you can
calculate the amplitude and phase of the complex exponential using some high school
trigonometry. For a complex exponential ) ( ) ( ) ( ? ? ? ib a F + = ,
1) The amplitude, which is the length of the vector, can be calculated using the
Pythagorean theorem:
2 2
) ( ) ( ) ( ? ? ? b a F A + = =
2) The phase ( ) (? F ? ), which is the angle of the vector from the x-axis, can be
calculated based on the arctangent – the angle whose tangent is
) (
) (
?
?
a
b
.
Page 5
Fourier Analysis
Fourier analysis follows from Fourier’s theorem, which states that every function
can be completely expressed as a sum of sines and cosines of various amplitudes and
frequencies. This is a pretty impressive assertion – no matter what the shape of a
function, and how little it looks like a sine wave, it can be rewritten as a sum of sines and
cosines. The Fourier series tells you the amplitude and frequency of the sines and
cosines that you should add up to recreate your original function.
Before getting into the details of Fourier series, it may help to briefly review the
terms associated with a sine wave with the figure below.
A cosine wave is just a sine wave shifted in phase by 90
o
(f=90
o
).
Cosine functions are even functions while sine wave are odd functions. An even
function is symmetric with respect to the y-axis, meaning that its graph remains
unchanged after reflection about the y-axis. On the other hand, an odd function is
symmetric with respect to the origin, meaning that its graph remains unchanged after
rotation of 180 degrees about the origin.
In the language of linear algebra, Fourier’s theorem states that sine waves and
cosine wave create a complete basis set that spans all possible functions. Sines and
cosines are in fact independent (and also orthogonal) -- there is no way to add up cosine
waves to create a sine wave.
A nice example of Fourier’s Theorem is the creation of a square wave by
summing the appropriate component sine waves. Like a sine or a cosine wave, a square
A = amplitude
f = phase (offset)
) 2 sin( ) ( ? p? + = t A t f
A
1/?
f
? = frequency
1/? = period = 1/frequency
f
t
degrees
wave is a periodic function. Unlike those other functions, a square wave has sharp
corners at 90
o
angles (see figure below).
SQUARE WAVE
How could we create a square wave out of sines and cosines? In the figure below,
the top panels represents a waveform and the bottom panel represents the sine waves that
are added together to form the waveform. Each column contains one more component
sine wave than the previous panel. As you can see, as you add up more sine waves, the
resulting waveform starts to look more and more like a square wave. An infinite sum of
the appropriately chosen sine waves would lead to a perfect square wave.
summed
waveform
component
sine waves
How did I know which sine wave should be summed to create the square wave?
The Fourier series is used to figure out which sine and cosine waves should be summed,
at what amplitude, to create a periodic waveform of interest. This is the Fourier series for
a square wave:
?
8
=
+
+
=
+ + + + =
0
1 2
) 1 2 sin(
...
7
7 sin
5
5 sin
3
3 sin
sin ) (
k
k
x k
x x x
x x square
p
p p p
p
Notice that only sines, and not cosines, contribute to creating the square wave.
That’s because the square wave that I’ve drawn is an odd function, just like a sine wave.
If we shifted the square wave by 90
o
, we would have summed cosines to create it instead.
Once we know the Fourier series for a square wave, the square wave can easily be
expressed in the frequency domain. This involves plotting the amplitude or the power
spectrum. The amplitude spectrum is just the amplitude of the sine/cosine at each
frequency, while the power spectrum is the square of the amplitude spectrum. Based on
the equation for the square wave above, the amplitude is 1 for frequency of 1 (?=1), 1/3
for frequency of 3 (?=3), and so on. The amplitude/power is zero at even frequencies for
this square wave example.
The figure below is another simple example of plotting the same signal in both the
time domain and frequency domain. The sine waves represented by the top two rows are
summed to create the waveform in the bottom row. The right column shows how much
power is in each frequency (“power spectrum”). Notice that the power is zero at most
frequencies. This is because the waveforms in this example are composed of either 1 or 2
sine waves, so most frequencies are not contributing any power to the signal.
The extension of a Fourier series for a non-periodic function is known as the
Fourier transform. When calculating the Fourier transform, rather than decomposing a
signal in terms of sines and cosines, people often use complex exponentials. They can be
a little easier to interpret, although they are mathematically equivalent. A complex
exponential is defined as Ae
if
, where i
2
=-1 (i is the “imaginary” number), A is the
amplitude, and f is the phase. A waveform can be decomposed in terms of complex
exponentials rather than sines and cosines because of Euler’s Theorem, which highlights
the surprisingly close relationship between a complex exponential and sines/cosines.
EULER’S THEOREM:
f f
f
sin cos i e
i
+ =
The Fourier transform allows you to write any function (f(t)) as the integral (sum)
across frequencies of complex exponentials of different amplitudes and phases (F(?)).
f(t) is often called the “time domain” representation while F(?) is called the “frequency
domain representation.” The key thing to understand about Fourier transforms is that
these two representations are different ways of expressing the same information. The
formula for a Fourier transform is below:
) (
) ( ) (
) (
2
1
) (
? f
?
? ?
? ?
p
i
t i
e A F
d e F t f
=
=
?
8
8 -
When you use a computer to take a Fourier transform of a function f(t), the
computer will return the complex number F(?), which you should think of as a vector in
the complex plane, as plotted below. The complex plane is a 2-D plane with real
numbers along the x-axis and imaginary numbers along the y-axis.
a(?)
b(?)
F(?)=
a(?)+ib(?)
Real
Imaginary
The easiest way to interpret F(?) is by calculating the amplitude (A) and the
phase (f) at each frequency. The amplitude (or “magnitude”) tells you how much signal
there is at a given frequency, whereas the phase tells you the delay of the signal at a given
frequency. Based on the geometric interpretation of a complex exponential, you can
calculate the amplitude and phase of the complex exponential using some high school
trigonometry. For a complex exponential ) ( ) ( ) ( ? ? ? ib a F + = ,
1) The amplitude, which is the length of the vector, can be calculated using the
Pythagorean theorem:
2 2
) ( ) ( ) ( ? ? ? b a F A + = =
2) The phase ( ) (? F ? ), which is the angle of the vector from the x-axis, can be
calculated based on the arctangent – the angle whose tangent is
) (
) (
?
?
a
b
.
f=
) (
) (
tan ) (
1
?
?
?
a
b
F
-
= ?
Once you know the complex exponential F(?), you can transform back into the
time domain by calculating the inverse Fourier transform, and recover the original
function f(t).
Below, you can see the Fourier Transform for a sine wave and a phase-shifted
sine wave. Notice that the amplitude is identical for these two conditions, but the phase is
different, reflecting the fact that the two signals are simply phase shifted (i.e. spatially
offset) versions of each other.
So, why would you want to take a Fourier transform? Fourier analysis can be
very useful for two main reasons.
1. Many calculations are simpler in the frequency domain than the time domain.
• For example: filtering (convolving) becomes trivial in the frequency
domain. We’ll talk about this next chapter.
2. Many neural processes can be described more effectively in the frequency
domain.
• For example: The cochlea transforms a time domain signal (the
sound’s waveform) into a frequency domain signal. The strength of the
response in the auditory nerve fiber tuned to a particular frequency
reflects the amplitude of the sound’s waveform at that frequency. In
other words, the auditory system takes a Fourier transform of the
incoming signal, decomposing the sound into amplitudes as a function
of frequency.
Sine wave Phase shifted sine wave
Frequency Frequency
Time Time
Phase
Amplitude
Read More