You are on page 1of 37

Chapter 16

Fourier Analysis with MATLAB


Fourier analysis is the process of
representing a function in terms of
sinusoidal components. It is widely
employed in many areas of engineering,
science, and applied mathematics. It
provides information as to what frequency
components represent a function. Some
basic principles and the means for
performing the analysis with MATLAB will
be considered in this chapter.
1

Initial Assumptions
Since many of the variables for which
Fourier analysis is required are functions of
time t, we will use it as the independent
variable. The dependent variable will be
denoted as x(t). The function x(t) is said to
be in the time domain and the Fourier
representation is said to be in the frequency
domain. The frequency domain form is
called the spectrum. We will first consider
the spectra of periodic functions. A periodic
function satisfies x(t) = x(t+T)
2

Periodic Function
The function below is an example of a
periodic function with period T.

x(t T ) x(t )

Fourier Series for Periodic Functions


Spectral analysis of periodic functions is
achieved through the Fourier series. The
3 forms are
(1) cosine-sine form,
(2) amplitude-phase form, and
(3) complex exponential form.
(1) and (2) are referred to as one-sided
forms and (3) will be referred to as a twosided form. A constant term in the series
is often called the dc value.
4

Simple Initial Analysis

(1) Do the series have a constant or dc term?


Check to see if the net area in a cycle is 0.

(2) What is the fundamental frequency?


f1 1/ T
(3) All other frequencies are integer multiples
of the fundamental; i. e., 2 f1 ,3 f1 , 4 f1, etc.
5

Example 16-1. List frequencies for the


assumed periodic waveform below.
Only one cycle is shown.

Example 16-1. Continuation.


Since the positive area is clearly greater
than the negative area, there will be a
constant or dc term in the series.
1
f1
200 Hz
0.005

The frequencies are


0 (dc)
200 Hz
400 Hz
600 Hz
800 Hz, etc.
7

Fourier Series Cosine-Sine Form

x(t ) A0 ( An cos n1t Bn sin n1t )


n 1

2
1 2 f1
T
1
f1
T
8

Fourier Series Cosine-Sine Form


(Continuation)

algebraic area under curve in one cycle


A0
T
1 T
x(t )dt
T 0
2 T
An x(t ) cos n1tdt
T 0
2 T
Bn x(t ) sin n1tdt
T 0
9

Fourier Series Amplitude-Phase Form

x(t ) C0 Cn cos(n1t n )
n 1

Cn A B
2
n

2
n

Bn
n tan

An
1

10

Fourier Series Complex Exponential Form

x(t )

Xe

in1t

1 T
in1t
Xn x(t )e
dt
T 0
11

Some Relationships

X n Xn

An iBn
Xn
2

X n X n

Cn

for n 0

X 0 C0
12

Example 16-2. A Fourier series is


given below. List frequencies and plot
the one-sided amplitude spectrum.

x(t ) 12 9 cos(2 10t / 3)


6 cos(2 20t / 6)
4 cos(2 30t / 4)
The frequencies are
0 (dc)
10 Hz
20 Hz
30 Hz
13

One-Sided Amplitude Spectrum of


Example 16-2

14

Two-Sided Amplitude Spectrum of


Example 16-3

15

Periodic Function of Examples 16-4,


16-5, and 16-6.
x(t ) A
0

for -T / 4 t T / 4
elsewhere in a cycle

16

Example 16-4. Determine Fourier series.

By inspection, A0 0.5 A
2 T/ 2
An x(t ) cos n1tdt
T T / 2
2 T/ 4

A cos n1tdt
T T / 4
2A
T /4
An
sin n1t T / 4
n1T
2A

[sin n1T / 4 sin( n1T / 4)]


n1T

17

Example 16-4. Continuation.

1T 2 f1T 2 (1/ T )T 2

2A
n
An
sin
n
2
n
sin
0 for n even
2
= 1 for n 1, 5, 9, etc.
= -1 for n 3, 7, 11, etc.

It can be shown that Bn 0.


18

Example 16-5. One-Sided Spectral Plot

19

Example 16-6. Two-Sided Spectral Plot

20

Fourier Transform

Assume a non-periodic function x(t ).


The Fourier transform is X( f ).

X( f ) x(t )e

it

dt

2 f

x(t ) X( f )e df
it

21

Amplitude and Phase Spectra

X ( f ) X ( f )e

i ( f )

@X ( f ) ( f )

Amplitude Spectrum = X ( f ) X( f )
Phase Spectrum = ( f ) ang X( f )

22

Comparison of Fourier Series and


Fourier Transform
The Fourier series is usually applied to a
periodic function and the transform is
usually applied to a non-periodic function.
The spectrum of a periodic function is a
function of a discrete frequency variable.
The spectrum of a non-periodic function is
a function of a continuous frequency
variable.
23

Example 16-7. Determine the Fourier


transform of the function below.

x(t ) e

for t 0
for t 0

X( f ) x(t )e

it

e e
0

t it

dt

dt e
0

( i ) t

dt
24

Example 16-7. Continuation.

e
X( f )

( i )
( i ) t

1
1
0

( i ) ( i )

1
1
X ( f ) X( f )

2
2
i

( f ) tan

25

Example 16-8. Determine the Fourier


transform of the function below.

x(t ) A for 0 t
0 elsewhere

X( f ) x(t )e

it

dt Ae
0

it

it

Ae
dt

e i 1
1 e i
A
A

i
i

26

Example 16-8. Continuation.

sin f i f
X( f ) A
e
f

sin f
X ( f ) A

( f ) f
27

Discrete and Fast Fourier Transforms


The discrete Fourier transform (DFT) is a
summation that produces spectral terms
that may be applied to either periodic or
non-periodic functions.
The fast Fourier transform (FFT) is a
computationally efficient algorithm for
computing the DFT at much higher speeds.
The IDFT and IFFT are the corresponding
inverse transforms.
28

Sampled Signal
Assume that N equally spaced samples of a function
are taken with a spacing of t between samples.
Let n represent the independent variable defined
over the domain 0 n N 1. The total length of
the function is T N t. For a continuous function
xc (t ), define a function x( n) as

x(n) xc (nt ) for n an integer


= 0 elsewhere
29

Definitions of DFT and IDFT


N 1

X ( m ) x ( n )e

i 2 mn / N

n 0

for 0 m N 1

1
x ( n)
N

N 1

X ( m)e

i 2 nm / N

m0

time n
frequency m
30

Initial Assumptions for MATLAB


The function must be interpreted as
periodic.
It is recommended that the number of
points N be even.
The spectrum will also be periodic. It will
be unique only at N/2 points.
The integer for a MATLAB indexed
variable must start at a value of 1.
The highest unambiguous frequency
corresponds to a MATLAB index of N/2.
31

32

33

34

35

36

37

You might also like