30
CE00998-3 Coding and Transformations Sept - Nov 2010

CE00998-3 Coding and Transformations Sept - Nov 2010

Embed Size (px)

Citation preview

Page 1: CE00998-3 Coding and Transformations Sept - Nov 2010

CE00998-3Coding and

Transformations

Sept - Nov 2010

Page 2: CE00998-3 Coding and Transformations Sept - Nov 2010

Teaching Staff

Module Leader: Dr Pat Lewis (K219, [email protected], 353549)

Other Teaching Staff: Prof Brian Burrows (K221, [email protected], 353420)

Dr Martin Paisley (K219, [email protected], 353549)

Mr Chris Mann (K219, [email protected], 353549)

Page 3: CE00998-3 Coding and Transformations Sept - Nov 2010

Lectures/Tutorials• Large lecture (all together)

Mon 10.00-11.00 (D109)

• Small lecture/tutorial

Group 1: Weds 11.00-13.00 (C307)

Group 2: Mon 13.00-15.00 (C307)

Group 3: Tues 09.00-11.00 (C328)

• Lab session

Group 1: Fri 11.00-12.00 (KC001)

Group 2: Weds 10.00-11.00 (KC001)

Group 3: Weds 10.00-11.00 (KC001)

Page 4: CE00998-3 Coding and Transformations Sept - Nov 2010

Module Aims

To introduce key mathematical techniques for modern digital signal processing, and coding/information theory

• Decomposition of a periodic function into its harmonics (frequency analysis)

• Mapping from the time domain to the frequency domain (filtering for image enhancement, noise reduction etc)

• Algorithms for high-speed computing

• Efficient coding algorithms

Page 5: CE00998-3 Coding and Transformations Sept - Nov 2010

Topics Covered

• Maple Mathematical Software• Fourier Series• Fourier Transforms• Discrete Fourier Analysis and

Fast Fourier Transform• Coding

Page 6: CE00998-3 Coding and Transformations Sept - Nov 2010

ScheduleWeek Grande Lecture Petite Lecture Tutorial Lab

6 Sep Introduction Intro to MAPLE Intro MAPLE Integration

13 Sep Integration by Parts Step Functions Matrices Programming

20 Sep Fourier Series Fourier Series Examples MAPLE

27 Sep FS Odd & Even Functions Examples MAPLE

4 Oct FS Complex Form Examples Assignment 1

11 Oct Class Test 1 Fourier Transforms Examples MAPLE

18 Oct FT Properties Examples MAPLE

25 Oct FT Generalised Functions Examples Assignment 2

1 Nov Class Test 2 Discrete FT Examples MAPLE

8 Nov DFT Fast FT Examples Assignment 3

15 Nov DFT Huffman Coding Examples MAPLE

22 Nov Class Test 3

Page 7: CE00998-3 Coding and Transformations Sept - Nov 2010

1. Introduction2. Sine and Cosine3. What is a Fourier Series?4. Some Demonstrations

Week 3Introduction to Fourier Series

Page 8: CE00998-3 Coding and Transformations Sept - Nov 2010

• Fourier methods and their generalisations lie at the heart of modern digital signal processing

• Fourier analysis starts by– representing complicated periodicity by harmonics of

simpler periodic functions: sine and cosine– “frequency domain representation”

Introduction

Page 9: CE00998-3 Coding and Transformations Sept - Nov 2010

Joseph Fourier (1768-1830)• Born in Auxerre• Scientific advisor to

Napoleon during invasion of Egypt in 1798

• Introduced Fourier Series in “Theorie Analytique de la Chaleur “ for heat flow analysis in 1822.

• Discovered the ‘greenhouse effect’

Page 10: CE00998-3 Coding and Transformations Sept - Nov 2010

Fourier’s discovery

• Any periodic function…

• …can be represented as a sum of harmonics of sine and/or cosine

3 6 9 -3 -9 -6

2

0

2 4 6 -2 -4 -6 0

1

Page 11: CE00998-3 Coding and Transformations Sept - Nov 2010

Sine and Cosine

xsin (x)

cos (x)

sin (x)

cos (x)

cos(x) and sin(x) are periodic with period 2

1

Page 12: CE00998-3 Coding and Transformations Sept - Nov 2010

Other Periods?

sin(2x)

Periodic with period 1

cos(2x)

Page 13: CE00998-3 Coding and Transformations Sept - Nov 2010

Other Periods?

sin(2x/T)

cos(2x/T)

T

T

Periodic with period Teg T=13.2

Page 14: CE00998-3 Coding and Transformations Sept - Nov 2010

Harmonics

T

xn2cos

T

xn2sin

n=1 n=2 n=3

n=1 n=2 n=3

Page 15: CE00998-3 Coding and Transformations Sept - Nov 2010

What is a Fourier Series?

• The representation of a periodic function as a sum of harmonics of sine and/or cosine

10

2sin

2cos

2

1)(

nnn T

xnb

T

xnaaxf

• An infinite series but usually only a few terms are needed for a reasonable approximation

Page 16: CE00998-3 Coding and Transformations Sept - Nov 2010

Finding the Fourier Series

The coefficients are given by

10

2sin

2cos

2

1)(

nnn T

xnb

T

xnaaxf

T

dxxfT

a0

0 )(2

T

n dxT

xnxf

Ta

0

2cos)(

2

T

n dxT

xnxf

Tb

0

2sin)(

2

(so is…? 02

1a …the mean value of f(x))

)...1( n

)...1( n

Page 17: CE00998-3 Coding and Transformations Sept - Nov 2010

Square Wave Demo

• Find the Fourier series for

2.x0when1

0x2-when0)(xf

Page 18: CE00998-3 Coding and Transformations Sept - Nov 2010

Square Wave Demo

• More integration for the other coefficients shows that the series is

...

2

5sin5

1

2

3sin3

1

2sin

2

2

1)(

xxxxf

• Easy integration for

T

dxxfT

a0

0 )(2

2

0

4

2

014

2dxdx 0

2

1 20 x 2

2

1 1

0a

Page 19: CE00998-3 Coding and Transformations Sept - Nov 2010

Square Wave Demo• What does it look like?

2

sin2

2

1)(

xxf

2

3sin3

1

2sin

2

2

1)(

xxxf

Page 20: CE00998-3 Coding and Transformations Sept - Nov 2010

Square Wave Demo• What does it look like?

2

5sin5

1

2

3sin3

1

2sin

2

2

1)(

xxxxf

2

17sin

17

1...

2

5sin5

1

2

3sin3

1

2sin

2

2

1)(

xxxxxf

Page 21: CE00998-3 Coding and Transformations Sept - Nov 2010

Square Wave Demo• What does it look like?

2

47sin

47

1...

2

5sin5

1

2

3sin3

1

2sin

2

2

1)(

xxxxxf

2

199sin

199

1...

2

5sin5

1

2

3sin3

1

2sin

2

2

1)(

xxxxxf

Page 22: CE00998-3 Coding and Transformations Sept - Nov 2010

• Search on youtube for “square wave Fourier series”

Square Wave Demo

(For music lovers: when the frequency doubles the pitch of the note rises by one octave)

Page 23: CE00998-3 Coding and Transformations Sept - Nov 2010

Saw Tooth Wave Demo

• Find the Fourier series for the function of period 4 given by

40for)( xxxf

Page 24: CE00998-3 Coding and Transformations Sept - Nov 2010

Saw Tooth Wave Demo

• More integration for the other coefficients shows that the series is

....

2

3sin3

1

2

2sin2

1

2sin1

142)(

xxxxf

• Easy integration for

T

dxxfT

a0

0 )(2

4

04

2xdx

4

0

2

22

1

x

2

0

2

4

2

1 22

4

0a

Page 25: CE00998-3 Coding and Transformations Sept - Nov 2010

Saw Tooth Wave Demo• What does it look like?

2

sin4

2)(x

xf

2

2sin2

1

2sin

42)(

xxxf

Page 26: CE00998-3 Coding and Transformations Sept - Nov 2010

Saw Tooth Wave Demo• What does it look like?

2

3sin3

1

2

2sin2

1

2sin1

142)(

xxxxf

2

4sin4

1

2

3sin3

1

2

2sin2

1

2sin1

142)(

xxxxxf

Page 27: CE00998-3 Coding and Transformations Sept - Nov 2010

Saw Tooth Wave Demo• What does it look like?

2

24sin

24

1...

2

2sin2

1

2sin1

142)(

xxxxf

2

99sin

99

1...

2

2sin2

1

2sin1

142)(

xxxxf

Page 28: CE00998-3 Coding and Transformations Sept - Nov 2010

• More on youtube for “square wave Fourier series”

• How many terms in the series are need for a ‘good’ representation?– It depends on the function

Saw Tooth Wave Demo

Page 29: CE00998-3 Coding and Transformations Sept - Nov 2010

• Fourier analysis starts with the representation of periodic behaviour by sums of harmonics of sine and cosine functions

• The Fourier series tells you which harmonics (frequencies) are present, and their relative amplitudes

• “Frequency domain representation”• The technique relies heavily on integration• There are some short cuts for ‘odd’ and even’

functions – see Week 4

Summary

Page 30: CE00998-3 Coding and Transformations Sept - Nov 2010

• The Fourier Series can be written in ‘complex form’ (where the sines and cosines are replaced by exponentials) – see Week 5. This is the form that will be used later in the module.

• Following discussion of the theory we will do some examples by hand calculation

• We will also use MAPLE to remove some of the hard work

Summary