29
Fourier Transforms and Frequency Domain analysis: Application to Solar Spectra (It’s very challenging for undergraduate students, but you can have a big extra credit. Note that it’s an extra credit . So it’s not required; it’s optional.)

Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

Fourier Transforms and

Frequency Domain analysis:

Application to Solar Spectra

(It’s very challenging for

undergraduate students, but you

can have a big extra credit.

Note that it’s an extra credit. So

it’s not required; it’s optional.)

Page 2: Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

However, whatever you do in

future, getting acquainted with

Fourier Transformation is very

useful in any field of science

and engineering.

It’s an extremely powerful

technique!

Page 3: Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

How to Represent (any) Signal (in mathematical form)?

• Option 1: Taylor series represents any function using

polynomials.

• Polynomials are not the best - unstable and not very

physically meaningful.

• Easier to talk about “signals” in terms of its “frequencies”

(how fast/often signals change, etc).

Credit: S. Narasimhan

Page 4: Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

Jean Baptiste Joseph Fourier (1768-1830)

• Had crazy idea (1807):

• Any periodic function can be

rewritten as a weighted sum

of Sines (sin) and Cosines

(cos) of different frequencies.

• Don’t believe it?

– Neither did Lagrange,

Laplace, Poisson and

other big wigs

– Not translated into

English until 1878!

• But it’s true!

– called Fourier Series

– Possibly the greatest tool

used in Engineering

Credit: S. Narasimhan

Page 5: Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

A Sum of Sinusoids

• Our building block:

• Add enough of them to

get any signal f(x) you

want!

• How many degrees of

freedom?

• What does each control?

• Which one encodes the

coarse vs. fine structure of

the signal?

xAsin(

Credit: S. Narasimhan

Page 6: Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

Fourier Transform

• We want to understand the frequency of our signal. So, let’s

reparametrize the signal by instead of x:

xAsin(

f(x) F()Fourier

Transform

F() f(x)Inverse Fourier

Transform

• For every from 0 to infinite, F() holds the amplitude A and

phase of the corresponding sine

– How can F hold both? Complex number trick!

)()()( iIRF

22 )()( IRA )(

)(tan 1

R

I

Credit: S. Narasimhan

Page 7: Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

Time and Frequency

• example : g(t) = sin(2πf t) + (1/3)sin(2π (3f ) t)

Credit: S. Narasimhan

Page 8: Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

Time and Frequency

= +

• example : g(t) = sin(2πf t) + (1/3)sin(2π (3f ) t)

Credit: S. Narasimhan

Page 9: Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

Frequency Spectra

• example : g(t) = sin(2πf t) + (1/3)sin(2π(3f ) t)

= +

Credit: S. Narasimhan

Page 10: Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

Fourier Transform – more formally

Arbitrary function Single Analytic Expression

Spatial Domain (x) Frequency Domain (u)

Represent the signal as an infinite weighted sum

of an infinite number of sinusoids

dxexfuF uxi 2

(Frequency Spectrum F(u))

1sincos ikikeikNote:

Inverse Fourier Transform (IFT)

dxeuFxf uxi 2

Credit: S. Narasimhan

Page 11: Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

• Also, defined as:

dxexfuF iux

1sincos ikikeikNote:

• Inverse Fourier Transform (IFT)

dxeuFxf iux

2

1

Fourier Transform

(Relates five most

important numbers.)

Page 12: Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

Fourier Transform Pairs (Examples)

angular frequency ( )iuxe

Note that these are derived using

Credit: S. Narasimhan

Page 13: Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

angular frequency ( )iuxe

Note that these are derived using

Fourier Transform Pairs (Examples)

Credit: S. Narasimhan

Page 14: Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

Properties of Fourier Transform

Spatial Domain (x) Frequency Domain (u)

Linearity xgcxfc 21 uGcuFc 21

Scaling axf

a

uF

a

1

Shifting 0xxf uFeuxi 02

Symmetry xF uf

Conjugation xf uF

Convolution xgxf uGuF

Differentiation n

n

dx

xfd uFui

n2

frequency ( )uxie 2

Note that these are derived using

Page 15: Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

Convolution

As a mathematical formula:

Convolutions are commutative:

(Symbols of ∗ or ⊗ often used for convolution)

Page 16: Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

Fourier Transform and Convolution

hfg

dxexguG uxi 2

dxdexhf uxi 2

dxexhdef xuiui 22

'' '22 dxexhdef uxiui

Let

Then

uHuF

Convolution in spatial (e.g., time series) domain

Multiplication in frequency domain

“Convolution”

Page 17: Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

Fourier Transform and Convolution

hfg FHG

fhg HFG

Spatial Domain (x) Frequency Domain (u)

So, we can find g(x) by Fourier transform

g f h

G F H

FT FTIFT

Page 18: Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

Convolution

Examples

Page 19: Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

Convolution Theorem

• The Fourier transform of a convolution is the product of the

Fourier transforms

• The Fourier transform of a product is the convolution of the

Fourier transforms

(Symbols of ∗ or ⊗ often used for convolution)

Page 20: Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

Cross Correlation

(Note: This is convolution.)

(Pay attention to

differences from

convolution.)

Page 21: Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

Auto Correlation

Power (density) spectrum!

Page 22: Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

But the data are not continuous.

Discrete Fourier

Transformation

(DFT)

Page 23: Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

Directional cosines

Directional cosines

forms orthonormal

basis for a vector.

And inner vector

product gives an

amplitude for each

direction (= each

directional cosine

vector).

Page 24: Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

Discrete Fourier Transformation

[cos(2πijk/N) & i sin(2πijk/N)]

are orthonormal basis functions

of DFT. Note i is for the

imaginary part of complex

number and j determines

frequency of each base. For

given spatial data (Xk), DTF

finds an amplitude (xj) for each

base (= different frequency).

Think about DFT as inner

product.

Fast Fourier Transformation

(FFT) belongs to DFT.

Page 25: Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

Frequency Spectra

Credit: S. Narasimhan

Page 26: Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

Discrete Fourier Transformation

Page 27: Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

Discrete Fourier Transformation

Page 28: Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

Discrete Fourier Transformation

Page 29: Fourier Transforms and Frequency Domain analysis ...astrolab/files/AST326_2017_Fourier_Transform… · f(x) Fourier F( ) Transform F( ) Inverse Fourier f(x) Transform • For every

Can use Python functions

• Use scipy functions fft(), ifft(), and conj()

• The FFT cross correlation will give you a

lag curve, but because the offset is close

to zero, you will see the correlation peak at

either end of the curve

– Hint: Try rolling the lag curve a small amount

to properly see the correlation peak