Spectral Analysis Using Excel - CSAAPTcsaapt.org/uploads/3/4/4/2/34425343/csaapt_tran_2017.pdf ·...
Transcript of Spectral Analysis Using Excel - CSAAPTcsaapt.org/uploads/3/4/4/2/34425343/csaapt_tran_2017.pdf ·...
Spectral Analysis Using Excel
P. Tran
John Tyler Community College
Overview
Calculating Fourier transform using Excel.
Spectral analysis of sound from a guitar.
Applications of Fourier Transform
Signal processing
Quantum mechanics: solving the time-dependent Schrödinger equation
Evolution of a Wave Packet in a 1D Potential
𝑖ℏ𝜕𝜓
𝜕𝑡= 𝐻𝜓
𝜓 𝑥, 𝑡 = 𝑒−𝑖𝐻ℏ𝑡 𝜓(𝑥, 0)
𝐻 =(ℏ𝑘)2
2𝑚+ 𝑉(𝑥)
𝜓 𝑥, Δ𝑡 ≅ 𝑒−𝑖ℏ𝑉(𝑥)
∆𝑡2 𝑒−
𝑖ℏℏ𝑘 2
2𝑚 ∆𝑡𝑒−𝑖ℏ𝑉(𝑥)
∆𝑡2 𝜓(𝑥, 0)
Evolution of a Wave Packet in a 1D Potential
𝜓1 𝑥, Δ𝑡 = 𝑒−𝑖ℏ𝑉(𝑥)
∆𝑡2 𝜓(𝑥, 0)
𝜓2 𝑥, Δ𝑡 = 𝑒−𝑖ℏℏ𝑘 2
2𝑚 ∆𝑡𝜓1 𝑥, Δ𝑡
𝜓 𝑥, Δ𝑡 = 𝑒−𝑖ℏ𝑉(𝑥)
∆𝑡2 𝜓2 𝑥, Δ𝑡
𝜓 𝑥, Δ𝑡 ≅ 𝑒−𝑖ℏ𝑉(𝑥)
∆𝑡2 𝑒−
𝑖ℏℏ𝑘 2
2𝑚∆𝑡𝑒−
𝑖ℏ𝑉(𝑥)
∆𝑡2 𝜓(𝑥, 0)
Diagonal in real space
Diagonal in k space
Diagonal in real space
Why Excel?
Want a computing platform that all students can have access to.
Nuts and Bolts
𝑓 𝜔𝑖 = න𝑓(𝑡)𝑒−𝑖𝜔𝑖𝑡 𝑑𝑡
Don’t calculate all components at once: too much typing.
Use iterative option of Excel.
Calculate the ith component during the ith iteration. Save for use later.
Data
Window
Data × window
cos (nti)
sin (nti)
ti
Be Careful
Excel calculates from left to right and top down for each iteration.
So make sure instructions are in the correct order.
Not FFT
Can program to do FFT.
But too complex, and the gain in computation time for the data size is not worth it.
Tuning Fork (384 Hz)
-1.00
-0.80
-0.60
-0.40
-0.20
0.00
0.20
0.40
0.60
0.80
1.00
1.20
0 200 400 600 800 1000 1200
F(t)
Index
F(t)
F(t)
Window W(t)
F(t)W(t)
0.0000
0.0100
0.0200
0.0300
0.0400
0.0500
0.0600
0.0700
0.0800
0 100 200 300 400 500 600
F(w
)
Index
F(w)
384.8Hz
Usual Standing Wave Experiment
Wouldn’t it be more interesting to do an experiment with a musical instrument?
Standing Wave on a Guitar
-1.50
-1.00
-0.50
0.00
0.50
1.00
1.50
2.00
2.50
0 200 400 600 800 1000 1200
F(t)
Index
F(t)
F(t)
Window W(t)
F(t)W(t)
0.0000
0.0050
0.0100
0.0150
0.0200
0.0250
0.0300
0.0350
0.0400
0.0450
0.0500
0 100 200 300 400 500 600
F(w
)
Index
F(w)
Fundamental
2nd harmonic
3rd harmonic
4th harmonic
Frequency vs 1/Length
y = 56x - 4.5R² = 1.0
80
90
100
110
120
130
140
1.5 1.6 1.7 1.8 1.9 2 2.1 2.2 2.3 2.4
Freq
uen
cy (
Hz)
1/L (m-1)
Fundamental frequency v 1/length
Frequency vs Wave Speed
y = 0.94x - 17R² = 0.99
0
20
40
60
80
100
120
140
100 110 120 130 140 150
Freq
uen
cy (
Hz)
Speed (m/s)
Frequency vs Wave Speed
Strength vs Time
0
10
20
30
40
50
60
0 0.1 0.2 0.3 0.4 0.5
Stre
ngt
h
Time (s)
Strength vs time
Fundamental
2nd harmonic
3rd harmonic
4th harmonic
What Else?
Pluck the string at different positions to see how that affects the composition of the
different harmonics.
Benefits Over Old Experiment
Students can see how physics works in a real life application.
Teach the principle of superposition of waves.
Difficulty
We only have one guitar.
Solution: ask students to bring in their own if they have one.
Thank you