You are on page 1of 36

Math meets Music:

Intro to Fourier Series


BY JORDAN KEARNS (W&L ‘14)
& JON ERICKSON (STILL HERE )
220 Hz (A3)

Instrument 1 Instrument 2 Sine Wave

Why do they sound different?


Waveform (A = 220 Hz)
To = 4.5 ms
Piano

Guitar

Pure Sine Wave


Overtones and Music Perception
Overtones occur at integer multiples of the fundamental
frequency when an object vibrates. The addition of these tones at
regular intervals is musical to the human ear.
Example:
Fundamental (1st Harmonic): 220Hz
1st Overtone (2nd Harmonic): 440Hz
2nd Overtone (3rd Harmonic): 660Hz
Video produced by Brandon Pletsch
Univ. of Georgia Medical School
URL: https://www.youtube.com/watch?v=PeTriGTENoc
Oscillation Modes: Stringed Instruments
Oscillation Frequency
f1

f 2 = 2 f1

f 3 = 3 f1

f 4 = 4 f1

f 5 = 5 f1
Frequency Spectrum
Piano Guitar

Integer multiple frequencies


(harmonic series)
Piano: Component Sine Waves
Composite Wave: Superposition of sines + cosines
Microphone Signal Amplitude

Time
Recorded waveform
Piano: Component Sine Waves
Composite Wave
(From Previous Slide)

Original Piano Wave

Look how close with only three sine waves!!!

Try it yourself: http://lpsa.swarthmore.edu/Fourier/Series/WhyFS.html


Fourier Series and Superposition
Any wave (sound) can be mathematically represented as some combination of
sine waves.
Wave= SineWave1 + SineWave2 + SineWave3+…

Fourier Series = Frequency Spectrum lets us see the component frequencies


that make up the unique sound!
Frequency Spectrum
Piano Guitar

|FFT|

n=1 2 3 4 5 n=1 2 3 4 5
Fourier Series: Trig Functions
Periodic functions (e.g., sound vs time) can be mathematically represented as
some superposition of sine and cosine waves!
More Periodic Functions built from sines + cosines
Example: The Electrocardiogram as a Sum of Sinusoids

Image credit/try it yourself!: Eric Cheever, Swarthmore Engineering: https://lpsa.swarthmore.edu/Fourier/Series/WhyFS.html


Fourier Series: Trig Functions
Periodic functions (e.g., sound vs time) can be mathematically represented as
some superposition of sine and cosine waves!
Complex Exponential Form

1𝜋 1𝜋 2𝜋 2𝜋 3𝜋 3𝜋
𝑎1 cos 𝑥 +¿ 𝑏1 sin 𝑥¿ 𝑎2 cos 𝑥+¿ 𝑏 2 sin 𝑥¿ 𝑎3 cos 𝑥 +¿ 𝑏3 sin 𝑥¿
𝐿 𝐿 𝐿 𝐿 𝐿 𝐿
Trig vs. Exponential

Average value of f(x)

→ 2|𝑐𝑛|= √ 𝑎 +𝑏 2
𝑛
2
𝑛

Complex conjugates!
Orthogonality: 2-D and continuous
domain
⃗𝑓 ⃗ ⃗ = 𝑓 1 𝑔 1+ 𝑓 2 𝑔 2
𝑓 ∙𝑔
⃗𝑔

𝑓 (𝑥) 𝑔(𝑥 )
Solving for Fourier Coefficients

Orthogonality!
Only one non-zero term, m = n
Integration zeros out the rest

Rearrange and voila!


TIME DOMAIN FREQUENCY DOMAIN

cos(2 50t) cos(2 50t) in the Frequency Domain


1
0.6

0 0.4

0.2
-1 0
0 0.01 0.02 0.03 0.04 0 100 200 300 400 500
cos(2 150t) cos(2 100t) in the Frequency Domain
1
0.6

0 0.4

0.2
-1 0
0 0.01 0.02 0.03 0.04 0 100 200 300 400 500
cos(2 300t) cos(2 300t) in the Frequency Domain
1
0.6

0 0.4

0.2

-1 0
0 0.01 0.02 0.03 0.04 0 100 200 300 400 500
Time (s) Frequency (Hz)
cos(2 50t) + cos(2 150t) Row 1 in the Frequency Domain
2 1

0 0.5

-2 0
0 0.01 0.02 0.03 0.04 0 100 200 300 400 500
cos(2 50t) + cos(2 150t) + cos(2 300t) Row 2 in the Frequency Domain
5 1

0 0.5

-5 0
0 0.01 0.02 0.03 0.04 0 100 200 300 400 500
1.0 cos(2 50t) + 1.2 cos(2 150t) + 0.5 cos(2 300t) Row 3 in the Frequency Domain
4 1

2
0.5
0

-2 0
0 0.01 0.02 0.03 0.04 0 100 200 300 400 500
Time (s) Frequency (Hz)
0.25 New Strings vs Old Strings

0.2

Magnitude Relative to Fundamental


Why you should
change strings 0.15

A quick experiment with a


spectrogram New String
Old String
0.1

0.05
Old New

0
2 3 4 5 6 7 8 9 10 11

Harmonic
Frequency
Spectra for
Different
Instruments
Same pitch played, but

TIMBRE
is entirely unique
Fourier Series: Trig Functions
Periodic functions (e.g., sound vs time) can be mathematically represented as
some superposition of sine and cosine waves!
Complex Exponential Form
Trig vs. Exponential

Average value of f(x)

Complex conjugates!
Orthogonality: 2-D and continuous
domain
⃗𝑓 ⃗ ⃗ = 𝑓 1 𝑔 1+ 𝑓 2 𝑔 2
𝑓 ∙𝑔
⃗𝑔

𝑓 (𝑥) 𝑔(𝑥 )
Solving for Fourier Coefficients

Orthogonality!
Only one non-zero term, m = n
Integration zeros out the rest

Rearrange and voila!


Total recall…
Extracting coefficients: orthogonality
“proof”
𝑚 ≠𝑛 𝑚=𝑛
sin(m ot) sin(n ot) sin(m ot) sin(n ot)
1 1

0.5 0.5

0 0

-0.5 -0.5

-1 -1
-0.2 -0.15 -0.1 -0.05 0 0.05 0.1 0.15 0.2 -0.2 -0.15 -0.1 -0.05 0 0.05 0.1 0.15 0.2

cos(m ot) sin(n ot) cos(m ot) sin(n ot)


1 1

0.5 0.5

0 0

-0.5 -0.5

-1 -1
-0.2 -0.15 -0.1 -0.05 0 0.05 0.1 0.15 0.2 -0.2 -0.15 -0.1 -0.05 0 0.05 0.1 0.15 0.2

cos(m ot) cos(n o t) cos(m ot) cos(n o t)


1 1

0.5 0.5

0 0

-0.5 -0.5

-1 -1
-0.2 -0.15 -0.1 -0.05 0 0.05 0.1 0.15 0.2 -0.2 -0.15 -0.1 -0.05 0 0.05 0.1 0.15 0.2
t (s) t (s)

m = 3, n = 1, T = 0.2 m = 2, n = 2, T = 0.2

Integrate over one period: m = n is the only case where any of these is non-zero. Allows us to extract an’s and bn’s
Orthogonality for trig functions
sin(m ot) sin(n ot) sin(m ot) sin(n ot)
1 1

0.5 0.5

0 0

-0.5 -0.5

-1 -1
-0.2 -0.15 -0.1 -0.05 0 0.05 0.1 0.15 0.2 -0.2 -0.15 -0.1 -0.05 0 0.05 0.1 0.15 0.2

cos(m ot) sin(n ot) cos(m ot) sin(n ot)


1 1

0.5 0.5

0 0

-0.5 -0.5

-1 -1
-0.2 -0.15 -0.1 -0.05 0 0.05 0.1 0.15 0.2 -0.2 -0.15 -0.1 -0.05 0 0.05 0.1 0.15 0.2

cos(m ot) cos(n o t) cos(m ot) cos(n o t)


1 1

0.5 0.5

0 0

-0.5 -0.5

-1 -1
-0.2 -0.15 -0.1 -0.05 0 0.05 0.1 0.15 0.2 -0.2 -0.15 -0.1 -0.05 0 0.05 0.1 0.15 0.2
t (s) t (s)

m = 1, n = 2, T = 0.2 m = 2, n = 3, T = 0.2
Biomedical
Example
“Everybody poops” by Ella E
GI electrical signals (small intestine)
GASTROINTESTINAL RHYTHMIC ACTIVITY GI ELECTRICAL SIGNALS (VOLTAGE VS. TIME)

V(t)

t
Fourier series representation
EXAMPLE RECORDED SIGNAL FOURIER SERIES REPRESENTATION

Single-Sided Amplitude Spectrum of y(t)


14
80

12
60
10
40
Signal (uV)

8
20

2|c|Y(f)|
n|
6

0
4

-20
2

-40
0 2 4 6 8 10 12 14 16 18 0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Time (s)
Frequency
Frequency (Hz)
(Hz)

Peaks occur at: 0.059, 0.293, 0.527, 0.820, 1.113, … Hz


Comparing math model to real life
MATH MODEL EMPIRICAL DATA
Fourier coefficient spectrum: periodic exp(-t/ ) Single-Sided Amplitude Spectrum of y(t)
110 14
100
12
90

80
10
70
8
60
|cn |

|Y(f)|
50
6
40

30 4

20
2
10

0 0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0 2 4 6 8 10 12 14 16 18 20
Frequency (Hz)
n (harmonic number
Harmonic Motion in Guitar
Modes of
Vibration:
Standing Waves
Piano C chord (2nd inversion)

C major chord

G4 (388)

E5 (657)

C5
1171
G5 (775) 1314
1564

You might also like