fourier analysis - welcome! | sens

19
Fourier Anyalysis FourierAnalysis.docx 10/17/2008 1:29 PM Page 1 Selection of Measurement System We need to choose an instrument which has the proper: (a) range - maximum and minimum (b) frequency response Suppose first we are dealing with a periodic signal The range is straightforward. How do we determine the required frequency response? We need to determine the "frequency content" of the periodic signal. -1.5 -1 -0.5 0 0.5 1 1.5 0 0.2 0.4 0.6 0.8 1 Amplitude Time sin(wt) Range Period

Upload: others

Post on 05-Jan-2022

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Fourier Analysis - Welcome! | SENS

Fourier Anyalysis

FourierAnalysis.docx 10/17/2008 1:29 PM Page 1

Selection of Measurement System We need to choose an instrument which has the proper:

(a) range - maximum and minimum

(b) frequency response

Suppose first we are dealing with a periodic signal

The range is straightforward. How do we determine the required frequency response? We need to determine the "frequency content" of the periodic signal.

-1.5

-1

-0.5

0

0.5

1

1.5

0 0.2 0.4 0.6 0.8 1

Am

plitu

de

Time

sin(wt)

Range

Period

Page 2: Fourier Analysis - Welcome! | SENS

Fourier Anyalysis

FourierAnalysis.docx 10/17/2008 1:29 PM Page 2

Frequency Domain Data is often transformed in a manner which makes the physics of interest either easier to see mathematically manipulate. i.e. Cartesian to polar coordinates, log - linear plots, Bode Diagram

Page 3: Fourier Analysis - Welcome! | SENS

Fourier Anyalysis

FourierAnalysis.docx 10/17/2008 1:29 PM Page 3

Fourier Analysis If we have a periodic signal which has a finite number of discontinuities (jumps) and has derivatives defined at each point in the interval, we can represent the signal as a sum of sine and cosine waves

-1.5

-1

-0.5

0

0.5

1

1.5

0 0.2 0.4 0.6 0.8 1

-1.5

-1

-0.5

0

0.5

1

1.5

0 0.2 0.4 0.6 0.8 1

Page 4: Fourier Analysis - Welcome! | SENS

Fourier Anyalysis

FourierAnalysis.docx 10/17/2008 1:29 PM Page 4

Mathematically

1

/ 2

0/ 2

/ 2

/ 2

/ 2

/ 2

cos sin (2.18)

where:

cos (2.17)

sin

o n n

n

T

T

T

nT

T

nT

2 2y(t)= + A nt + B ntA

T T

1A = y(t)dt

T

2A = y(t) n tdt

T

2B y(t) n tdt

T

The result is known as a Fourier Series.

Note : or

2 2 = T

T

which is the lowest frequency

possible in time T. This is known as the fundamental frequency, f0. Multiples of the fundamental frequency are known as harmonics. Substituting f0 into equation 2.18

0 0 0cos sinn n

n=1

y(t)= A + A f nt + B f nt

Page 5: Fourier Analysis - Welcome! | SENS

Fourier Anyalysis

FourierAnalysis.docx 10/17/2008 1:29 PM Page 5

A sum of sine and cosines can be rewritten as

0 cos (2.19)n n

n=1

y(t)= A + C nt -

Or

0( ) sin (2.20)*

nn

n=1

y t = A + C nt

(note error in 4th edition equation 2.20) where

(2.21)tan and tan

2 2n nn

*n n

n n

n n

C = +A B

B A =A B

This form has the advantage that it more clearly identifies the magnitude of each frequency component, Cn.

Even and Odd Functions Even functions are symmetric about the origin, odd functions are anti-symmetric

Even: g(-t) = g(t) i.e. cos(nt)

Odd: h(-t) = -h(t) i.e. sin(nt)

Therefore if y(t) is even the Fourier series will contain only cosine functions. If it is odd it will contain only sine functions.

Functions that are neither even nor odd result in Fourier series that contain both sine and cosine terms.

Page 6: Fourier Analysis - Welcome! | SENS

Fourier Anyalysis

FourierAnalysis.docx 10/17/2008 1:29 PM Page 6

Aperiodic Waveforms What about waveforms which are not periodic, such as a step. We can extend the waveform so that it becomes periodic: What makes Fourier series useful is that most functions can be closely approximated using a small number of terms. See Example 2.2 and Figure 2.9. (Example 2.3 and Figure 2.16 in the 2nd and 3rd Edition.)

Page 7: Fourier Analysis - Welcome! | SENS

Fourier Anyalysis

FourierAnalysis.docx 10/17/2008 1:29 PM Page 7

Figure 2.16 in 2nd and 3rd Edition

Page 8: Fourier Analysis - Welcome! | SENS

Fourier Anyalysis

FourierAnalysis.docx 10/17/2008 1:29 PM Page 8

Suppose the equation describing the waveform is not known so I am not able to perform the integrations analytically. I can then resort to numerical integration, using an appropriate numerical integration algorithm. If the number of points is large, a simple summation is probably sufficient:

0

( )sin

( )sin( )

where:

b

a

k

i i

i=0

i

f t (nt) dt

f nt tt

t = a, t = a - b,t = i t

Page 9: Fourier Analysis - Welcome! | SENS

Fourier Anyalysis

FourierAnalysis.docx 10/17/2008 1:29 PM Page 9

Laboratory 5 - Fourier analysis of low pass filter and waveforms. The equations from the 2nd edition of the text are the easiest to work with:

cos

sin

0 n

n=1

n

y(t) = + ( n tA A

+ n t ) (2.18)B

where

cos

sin

T/2

0

-T/2

T/2

n

-T/2

T/2

n

-T/2

1 = y(t) dtA

T

2 = y(t) n t dtA

T

2 = y(t) n t (2.17)B

T

Page 10: Fourier Analysis - Welcome! | SENS

Fourier Anyalysis

FourierAnalysis.docx 10/17/2008 1:29 PM Page 10

Since you don't have analytical expressions for y(t), you will have to use numerical integration. You have a large number of data points, so Simpson's rule is probably adequate. In order to assess the importance of the higher harmonics, it is easiest to convert Equation 2.18 to the form

cos

tan

0 n n

n=1

2 2n nn

n

n

n

y(t) = + ( n t - ) (2.19)CA

where = + C A B

B = (2.21)

A

The Fourier Transform

Review of Complex Arithmetic

Remember that the square root of -1 will be written as j (as contrasted with the i used in mathematics):

A complex number c consists of j and two real numbers a and b in the form

The real part of c is a, and the imaginary part is b. If a, b, g, and h are real, then the complex number (a + jb) and (g + jh) may be added and multiplied according to the formulas

Page 11: Fourier Analysis - Welcome! | SENS

Fourier Anyalysis

FourierAnalysis.docx 10/17/2008 1:29 PM Page 11

The complex conjugate of a complex number c is denoted by

For c = (a + jb), then

*

2 2

2 2

( )( - )

( ) ( )

cc a jb a jb

a b j ab ab

a b

Thus the product of cc* is always real.

The absolute value of c, written |c|, is defined as

or

Complex division is defined in the following manner:

2 2 2 2

a jb a jb g jh

g jh g jh g jh

ag bh bh ahj

g h g h

provided g2 + h2 0.

It is interesting to note that

a jba jb

g jh g jh

That is, the absolute value of a quotient is equal to the quotient of the absolute values.

Page 12: Fourier Analysis - Welcome! | SENS

Fourier Anyalysis

FourierAnalysis.docx 10/17/2008 1:29 PM Page 12

Euler's Relation

The following formula is known as Euler's relation:

exp( ) cos sinje j j

For = , the relation may be written as

1 0je

A complex number (a + jb) may be put into polar coordinates, r and , according to the rule

arctan

r a jb

b

a

so that

exp( )a jb r j

The Fourier Transform The most familiar is that which transforms the time function x(t) into the frequency function X(f) through the use of the following relationship:

( ) ( )exp( 2 )X f x t j ft dt

Sometimes this is written as:

( ) ( )X f F x t

The original independent variable is t is for time, usually in seconds,

and has the range of (- to ). The new independent variable f is

usually in units of hertz, abbreviated Hz. The range of f is also (- to

Page 13: Fourier Analysis - Welcome! | SENS

Fourier Anyalysis

FourierAnalysis.docx 10/17/2008 1:29 PM Page 13

). Sometimes is used rather than f. Remember = 2πf. The

variable is in radians per unit time.

The Fourier transform is reversible

( ) ( )exp( 2 )x t X f j ft df

or

1( ) ( )x t F X f

Page 14: Fourier Analysis - Welcome! | SENS

Fourier Anyalysis

FourierAnalysis.docx 10/17/2008 1:29 PM Page 14

Delta Functions

The delta functions δ(t) and δ(f) may be thought of as functions that have infinite height, zero width, and unit area! This does not make good mathematical sense, but if they are used appropriately they become more rational.

1. Ultimately they should be employed within integrals 2. They should be approximated by a sequence of functions which

in the limit has the desired properties The first statement leads to a more mathematical definition of the delta function:

0 0( ) ( ) ( )x t x t t t dt

Note the left side of this equation is a constant, x(t0).

Application of the Delta Function

Suppose it is desired to inverse transform (f-f0).

0 0( )exp( 2 ) exp( 2 )f f j ft df j f t

The result is a complex function of time. If Euler's relation is applied,

the result becomes

0 0 0exp( 2 ) cos2 sin 2j f t f t j f t

From this it is straightforward to find the Fourier transforms of

cos(2f0t) and sin(2f0t). This is done by first finding the inverse

Fourier transforms of (f+f0)

Page 15: Fourier Analysis - Welcome! | SENS

Fourier Anyalysis

FourierAnalysis.docx 10/17/2008 1:29 PM Page 15

0 0

0 0

( )exp( 2 ) exp( 2 )

cos 2 sin 2

f f j ft df j f t

f t j f t

Next, consider taking the inverse Fourier transform of the sum of two

delta functions:

0 0

0 0 0 0

0

( ) ( )exp( 2 )

2

1 1cos 2 sin 2 cos 2 sin 2

2 2

cos 2

f f f fj ft df

f t j f t f t j f t

f t

That is, the Fourier transform of cos(2f0t) is the two delta functions

(f - f0) and (f + f0), each multiplied by 1/2. Note the function is real!

If a similar procedure is followed for sin(2f0t), its transform is found to be

0 0( ) ( )

2

f f f f

The following points are of interest:

1. The transform of cos(2f0t) is completely real, whereas that of

sin(2f0t) is completely imaginary.

2. Both transforms are composed of delta functions centered at f0 and -f0 Hz.

3. The cosine transform is symmetric, whereas the sine transform is antisymetric.

Page 16: Fourier Analysis - Welcome! | SENS

Fourier Anyalysis

FourierAnalysis.docx 10/17/2008 1:29 PM Page 16

Page 17: Fourier Analysis - Welcome! | SENS

Fourier Anyalysis

FourierAnalysis.docx 10/17/2008 1:29 PM Page 17

The Effects of Finite Sample Length

Most of the functions discussed so far are defined for an infinite span of time, and therefore would correspond to a test of infinite duration.

Finite record length is modeled here through the use of the boxcar function u(t). Suppose x(t) is defined for all time and its Fourier transform is then X(f). If we record (observe) a restricted period, P from -P/2 to P/2 then this truncation of the x(t) function could be represented as

( ) ( ) ( )Px t x t u t

This is, by multiplying by the boxcar function, the resulting function xP(t) is 0 outside the range of -P/2 to P/2, and hence corresponds to a sample length of P.

The Fourier transform of u(t) and x(t) is assumed to be given. Because xP(t) is the product of two functions in the time domain, then its Fourier transform, (according to formula 3 in Table 1.1 above), must be a convolution in the frequency domain of X(f) and U(f).

sin

sin

P PF x t X f X U f d

f PX d

f

PX f d

Therefore, in general, the effect of having a finite record length is equivalent to convolving the original infinite length transform with a (sin x)/x function. This results in "smearing."

Page 18: Fourier Analysis - Welcome! | SENS

Fourier Anyalysis

FourierAnalysis.docx 10/17/2008 1:29 PM Page 18

Discrete Fourier Transform of Length N

If both X and x are discrete and with limited range we can define

1

0

2( ) ( )exp

N

i

j ikX k T x i

N

This form can be related to the infinite range transform with discrete x(i) by

1. Defining x(i) = 0 for i < 0 and i > N-1.

2. Defining fk = k/NT

When this is done,

Page 19: Fourier Analysis - Welcome! | SENS

Fourier Anyalysis

FourierAnalysis.docx 10/17/2008 1:29 PM Page 19

1

0

1

0

1

0

( ) ( ) exp 2

( )exp 2

2( )exp

N

k k

i

N

i

N

i

X f T x i j f iT

kT x i j iT

NT

j ikT x i

N

The inverse Fourier transform is defined in a similar manner:

1

0

2( ) ( )exp

N

k

j ikx i b X k

N

where b = 1/NT and fk = kb = k/NT

Points of note regarding the finite length discrete Fourier Transform

1. The fundamental frequency, f0 is the lowest frequency sine wave with a period equal to the record length.

a. record length = T = Nt = 1/f0

b. t = 1/fs

2. The frequency resolution is in steps of f0

3. The maximum frequency is the Nyquist frequency

a. fN = fs/2 = (N/2) f0

4. Only periodic input frequency which are exact multiples of f0 will be accurately captured without some amplitude ambiguity