fourier transforms and frequency domain analysis...

Post on 16-Oct-2020

4 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

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.)

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!

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

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

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

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

Time and Frequency

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

Credit: S. Narasimhan

Time and Frequency

= +

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

Credit: S. Narasimhan

Frequency Spectra

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

= +

Credit: S. Narasimhan

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

• Also, defined as:

dxexfuF iux

1sincos ikikeikNote:

• Inverse Fourier Transform (IFT)

dxeuFxf iux

2

1

Fourier Transform

(Relates five most

important numbers.)

Fourier Transform Pairs (Examples)

angular frequency ( )iuxe

Note that these are derived using

Credit: S. Narasimhan

angular frequency ( )iuxe

Note that these are derived using

Fourier Transform Pairs (Examples)

Credit: S. Narasimhan

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

Convolution

As a mathematical formula:

Convolutions are commutative:

(Symbols of ∗ or ⊗ often used for convolution)

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”

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

Convolution

Examples

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)

Cross Correlation

(Note: This is convolution.)

(Pay attention to

differences from

convolution.)

Auto Correlation

Power (density) spectrum!

But the data are not continuous.

Discrete Fourier

Transformation

(DFT)

Directional cosines

Directional cosines

forms orthonormal

basis for a vector.

And inner vector

product gives an

amplitude for each

direction (= each

directional cosine

vector).

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.

Frequency Spectra

Credit: S. Narasimhan

Discrete Fourier Transformation

Discrete Fourier Transformation

Discrete Fourier Transformation

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

top related