fourier series. the frequency domain it is sometimes preferable to work in the frequency domain...

15
Fourier series

Upload: magdalen-fletcher

Post on 12-Jan-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Fourier series. The frequency domain It is sometimes preferable to work in the frequency domain rather than time –Some mathematical operations are easier

Fourier series

Page 2: Fourier series. The frequency domain It is sometimes preferable to work in the frequency domain rather than time –Some mathematical operations are easier

The frequency domain

• It is sometimes preferable to work in the frequency domain rather than time– Some mathematical operations are easier in

the frequency domain– the human ear works on frequencies

• Working in this domain really means the x axis is f and not t.

• We need a method to convert time domain functions into frequency domain functions

Page 3: Fourier series. The frequency domain It is sometimes preferable to work in the frequency domain rather than time –Some mathematical operations are easier

Fourier Series

)sin()( tKtx

• A sinusoid can be represented by

• A sinusoid can be expressed as a sum of a sine and cosine at the same frequency but possibly different magnitudes independently of phase

)cos()sin()( So

constants be will)cos( and )sin( dependant, not time is As

)sin()cos()cos()sin()( So

B and ALet

sincoscossin)sin(identity trig theFrom

21 tKtKtx

tktktx

t

BABABA

Page 4: Fourier series. The frequency domain It is sometimes preferable to work in the frequency domain rather than time –Some mathematical operations are easier

• Adding sinusoids with freq F results in a sinusoid with frequency Fx(t)=sin(4πt) + 0.6cos(4πt)

Page 5: Fourier series. The frequency domain It is sometimes preferable to work in the frequency domain rather than time –Some mathematical operations are easier

x(t)=sin(4πt) + 0.6cos(4πt)

Page 6: Fourier series. The frequency domain It is sometimes preferable to work in the frequency domain rather than time –Some mathematical operations are easier

• Any periodic waveform can be represented as an infinite sum of sine and cosine waves regardless of phase (as shown in the previous slide). This is the Fourier Series f(t)

0 1 1 2 2 3 3( ) cos( ) sin( ) cos(2 ) sin(2 ) cos(3 ) sin(3 )...f t a a t b t a t b t a t b t

01 1

( ) cos( ) sin( )n nn n

f t a a n t b n t

• Or more succinctly written as:

• a0=const, an and bn are the amplitudes of the individual harmonics making up the periodic waveform

Page 7: Fourier series. The frequency domain It is sometimes preferable to work in the frequency domain rather than time –Some mathematical operations are easier

Discrete Fourier Transform DFT

• The data we will use is sampled and an infinite number of samples is impractical

• Works with non continuous non periodic functions

• N time domain samples transform to N complex DFT values in the frequency domain

Page 8: Fourier series. The frequency domain It is sometimes preferable to work in the frequency domain rather than time –Some mathematical operations are easier

Periodic function generation• Remember that you created a sine wave digitally using:

2( ) sin( )

There are samples in the waveform

2Substituting gives ( ) sin( )

This is now frequency independant but the fequency

can be restored if the sample rate is known or the samp

s

s

s

fnf n

F

FN

f

F nN f n

f N

le

rate can be restored if the frequency is known as

or ss

Ff F fN

N

Page 9: Fourier series. The frequency domain It is sometimes preferable to work in the frequency domain rather than time –Some mathematical operations are easier

• The DFT is:

1

0

21

0

2 2( ) ( ) cos( ) sin( )

or

( ) ( ) for 0 1

N

n

j hnNN

n

hn hnF h x n j

N N

F h x n e h N

• Where F is effectively a row matrix of size N• h is the harmonic• n is the time domain sample number• x(n) is the magnitude of the nth sample• N is the total number of samples

Page 10: Fourier series. The frequency domain It is sometimes preferable to work in the frequency domain rather than time –Some mathematical operations are easier

• As each Fourier coefficient F(h) is complex so its magnitude and phase (with respect to the fundamental) need to be calculated:

2 2

1

( ) R ( ) ( )

( )( ) tan

( )

where R means the real bit and I means imaginary bit

X h h I h

I hh

R h

Page 11: Fourier series. The frequency domain It is sometimes preferable to work in the frequency domain rather than time –Some mathematical operations are easier

Example• Consider 4 samples of a waveform from the

time domain (from an a to d converter) {1,0,0,1}

21

0

30 0

0

2 2 4 634 4 4 4

0

( ) ( ) for 0 1

(0) ( ) as k=0 1 for all so (0) 1 1 0 1 0 1 1 1 2

which is real as expected for a constant

(1) ( ) 1 1 0 0 1

j hnNN

n

n

j n j j j

n

F h x n e h N

F x n e e n x

F x n e e e e

3

2

2 2 1

3 31 0 0 1 cos( ) sin( )

2 2

1(1) 1 0 ( ) 1 so has a magniude of 1 1 2 phase angle tan 45 or

1 4

j

e j

F j j

Page 12: Fourier series. The frequency domain It is sometimes preferable to work in the frequency domain rather than time –Some mathematical operations are easier

• Show that x(2)=0 and x(3)=1-j• So the DFT of a time vector {1,0,0,1} is a vector {2,1+j,0,1-j}• These coefficients are frequency independent as no account for

frequency has been taken. We know that the second coefficient F(1) will represent the fundamental and the next one F(2) will be the next harmonic etc. If we need to find the fundamental frequency, we need to specify the coefficient in terms of sample frequency Fs where

if 8

frequency of (0) 0 as expected for the DC component

8000frequency of (1) 2

42 8000

frequency of (2) 44

3 8000frequency of (3) 6

4

sf kHz

F

F kHz

F kHz

F kHz

frequency ( ) shfF hN

Page 13: Fourier series. The frequency domain It is sometimes preferable to work in the frequency domain rather than time –Some mathematical operations are easier

Power phase diagram

• Often wish to represent Fourier spectrum diagrammatically

• Power is magnitude squared

• Phase is angle

• Line up power graph with phase graph

• Plot actual frequencies is sample rate known

• Usually only plot samples from 0 to N/2

Page 14: Fourier series. The frequency domain It is sometimes preferable to work in the frequency domain rather than time –Some mathematical operations are easier

• From example x = {1,0,0,1} giving Fourier coefficients of {2,1+j,0,1-j}

• If Fs=1000Hz, F1=1000/N=250, F2=500, F3=750

• Polar form of power and phase:

2 0 4 0

1 2 45

0 0 0

1 2 45

j

j

j

Page 15: Fourier series. The frequency domain It is sometimes preferable to work in the frequency domain rather than time –Some mathematical operations are easier

90

45

F

M

4

2

0 250 500 750 1k

-45

-90

0