59
Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: [email protected]

Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: [email protected]

  • View
    216

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

• Name: Dr. Peter Tsang

• Room: G6505

• Ext: 7763

• Email: [email protected]

Page 2: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

• Introduction to Digital Signal Processing• Digital Filter Design• Multi-rate Signal Processing• Wavelet• Applications

http://www.ee.cityu.edu.hk/~csl/adsp/adsp.html

Page 3: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

• A.N. Akansu et. al., “Multiresolution Signal Decomposition”, Academic Press.

• P.P. Vaidyanathan, “Multirate Systems and Filter Banks”, Prentice Hall.

Students are strongly recommended to look for reference books in the library

Page 4: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

Course Assessment: 100%Laboratory Sessions : 1st weeks 82nd weeks 10 to 13

Subject to change if necessary

Special ArrangementClass cancellation: Week 5 (6th Oct 2007)

Page 5: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

Expected outcome from students:

1. Familiarize with FIR and IIR Digital Filter Design.2. Establish the concept of Multi-resolution Signal Decomposition.3. Understanding the basic mathematical framework of Wavclet

Decomposition.4. Capable of designing and building Digital Filters, Multi-resolution and

Wavelet filter banks.5. Applying Wavelet Decomposition in image processing.

Page 6: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

x(t) Systemy(t) = G{x(t)}

Input signal

Transfer function (filter)Allow certain frequency band

to pass, and reject others

Outputsignal

Figure 1

Signal ProcessingSignal ProcessingSignal ProcessingSignal Processing

Page 7: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

x(t)

Input signal

Non-recursive system

Outputsignal

hFF(t)

hFF(t) Feed forward response

y(t) = G{x(t)}

Figure 2

Signal ProcessingSignal ProcessingSignal ProcessingSignal Processing

Page 8: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

x(t)

Input signal

Non-recursive system

Outputsignal

hFF(t)

y(t) = x(t) * hFF(t) (1)

y(t) = G{x(t)}

Figure 3

Signal ProcessingSignal ProcessingSignal ProcessingSignal Processing

Page 9: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

ConvolutionConvolutionConvolutionConvolution y(t) = x(t) * h (t)

0 1 2 3 4 5 6-1-2

h()

0 1 2 3 4 5 6-1-2

x( )

0 1 2 3 4 5 6-1-2

y(0)= AREA[h() x(-)]

-3-4-5

y t h x t d( )

0 1 2 3 4 5 6-1-2

y(1)= AREA[h() x(1-)]

-3-4-5

Page 10: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

ConvolutionConvolutionConvolutionConvolution y(t) = x(t) * h (t)

0 1 2 3 4 5 6-1-2

h()

0 1 2 3 4 5 6-1-2

x( )

0 1 2 3 4 5 6-1-2

y(2)= AREA[h() x(2-)]

-3-4-5

y t h x t d( )

0 1 2 3 4 5 6-1-2

y(3)= AREA[h() x(3-)]

-3-4-5

Page 11: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

x(t)

Input signal

Recursive system

Outputsignal

hFF(t)

hFB(t)

+

hFB(t) Feed backward response

y(t) = G{x(t)}

Figure 4

Signal ProcessingSignal ProcessingSignal ProcessingSignal Processing

Page 12: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

y(t) = x(t) * hFF(t) +

x(t)

Input signal

Recursive system

Outputsignal

hFF(t)

hFB(t)

+

y(t) * hFB(t) (2) Figure 5

y(t) = G{x(t)}

Signal ProcessingSignal ProcessingSignal ProcessingSignal Processing

Page 13: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

Analog systems are implemented with analog circuits built up with resistors, capacitors, inductors and transistors.

Both input and output signals are continuous waveforms.

Signal ProcessingSignal ProcessingSignal ProcessingSignal Processing

Page 14: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

Digital Signal Processing Digital Signal Processing - a five steps process- a five steps process

Digital Signal Processing Digital Signal Processing - a five steps process- a five steps process

Step 1 - Sampling

x(t)

x(nTS)

TS

Figure 6

Page 15: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

Step 2 - Analog to Digital Conversion (ADC)

x(nTS)

x(n) = [x(0) , x(1) , x(2) , ............ , x(N-2) , x(N-1)]Figure 7

Digital Signal Processing Digital Signal Processing - a five steps process- a five steps process

Digital Signal Processing Digital Signal Processing - a five steps process- a five steps process

Page 16: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

Step 3 - Computation on input data sequence

y(n) = 0.25x(n-1) + 0.5x(n) + 0.25x(n+1) (3)

e.g. A simple Low Pass Filter

Digital Signal Processing Digital Signal Processing - a five steps process- a five steps process

Digital Signal Processing Digital Signal Processing - a five steps process- a five steps process

Page 17: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

Step 4 - Digital to Analog Conversion (DAC)

y(nTS)

y(n) = [y(0) , y(1) , y(2) , ............ , y(N-2) , y(N-2)]

Figure 8

Digital Signal Processing Digital Signal Processing - a five steps process- a five steps process

Digital Signal Processing Digital Signal Processing - a five steps process- a five steps process

Page 18: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

Step 5 Interpolation

y(t)

y(nTS)

Figure 9

Digital Signal Processing Digital Signal Processing - a five steps process- a five steps process

Digital Signal Processing Digital Signal Processing - a five steps process- a five steps process

Page 19: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

x(t)x(n)

ADC

Digital Filter

DAC + Int.

y(n)y(t)

y(n) = G{x(n)}

Figure 10

Digital Signal ProcessingDigital Signal ProcessingDigital Signal ProcessingDigital Signal Processing

Page 20: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

Digital Signal Processing Digital Signal Processing - key issues- key issues

Digital Signal Processing Digital Signal Processing - key issues- key issues

1. Build a mathematical model of the system.

2. Design algorithms and formulations for the model

3. Apply the algorithms to the input data and calculate the output data

4. convert the data to the time domain

Page 21: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

Models and AlgorithmsModels and AlgorithmsModels and AlgorithmsModels and Algorithms

1. A model is a mathematical description on the response of the system

2. An algorithm is the realization of the model

Model: H(s) = 1/(s+b)R

CAnalog realization

Page 22: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

1. A model is a mathematical description on the response of the system

2. An algorithm is the realization of the model

Model: H(s) = 1/(s+b)Digital realization

y(n) = w1x(n-1) + w2x(n) + w3x(n+1)

Models and AlgorithmsModels and AlgorithmsModels and AlgorithmsModels and Algorithms

Page 23: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

Analog System: Determine transfer function H(s)Built circuit equivalent to H(s)

Digital system: Given H(s), how to determine the

equation and parameters?

Solution: A standardized equation for the class of linear time-invariant (LTI) systems.

Models and AlgorithmsModels and AlgorithmsModels and AlgorithmsModels and Algorithms

Page 24: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

What is an LTI system?What is an LTI system?What is an LTI system?What is an LTI system?

x1(n) Digital Filter

Linear y1(n)

x2(n) Digital Filter

y2(n)

Figure 11

Page 25: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

x1(n) Digital Filter

Linear y1(n)

x2(n) Digital Filter

y2(n)

x1(n) + x2(n) Digital Filter

y1(n) + y2(n)

Figure 12

What is an LTI system?What is an LTI system?What is an LTI system?What is an LTI system?

Page 26: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

Time Invariant

Same response to every part of the input sequence

Digital Filter

y (n) = G{x(n)}

x (n-no) Digital Filter

y (n-no) = G{x(n-no)}

x (n)

Figure 13

What is an LTI system?What is an LTI system?What is an LTI system?What is an LTI system?

Page 27: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

Generalised LTI systemGeneralised LTI systemGeneralised LTI systemGeneralised LTI system

(4)y (n) = ak y(n-k) +

k=1

Mbk x(n-k)

k= -NF

NF

Page 28: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

y (n) = ak y(n-k) +

k=1

Mbk x(n-k)

k= -NF

NF

Modifying parameters { M, NF, ak and bk}gives different responses (filtering functions).

(4)

Generalised LTI systemGeneralised LTI systemGeneralised LTI systemGeneralised LTI system

Page 29: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

SummarySummaryDesigning analog systemsDesigning analog systems

SummarySummaryDesigning analog systemsDesigning analog systems

• Identify the desire filter response (e.g. HP, LP, etc.)

Page 30: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

• Identify the desire filter response (e.g. HP, LP, etc.)• Determine the mathematical representation of the

response H(s)

SummarySummaryDesigning analog systemsDesigning analog systems

SummarySummaryDesigning analog systemsDesigning analog systems

Page 31: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

• Identify the desire filter response (e.g. HP, LP, etc.)• Determine the mathematical representation of the

response H(s)• Implement the filter circuit with RLC transistors

and FETs

SummarySummaryDesigning analog systemsDesigning analog systems

SummarySummaryDesigning analog systemsDesigning analog systems

Page 32: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

• Digitize the input analog signal into a sequence of data x(n) = [x(0), x(1), x(2), ........x(N-1)]

SummarySummaryDesigning digital systemsDesigning digital systems

SummarySummaryDesigning digital systemsDesigning digital systems

Page 33: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

• Digitize the input analog signal into a sequence of data x(n) = [x(0), x(1), x(2), ........x(N-1)]

• Identify the desire digital filter response (e.g. HP, LP, etc.)

SummarySummaryDesigning digital systemsDesigning digital systems

SummarySummaryDesigning digital systemsDesigning digital systems

Page 34: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

• Digitize the input analog signal into a sequence of data x(n) = [x(0), x(1), x(2), ........x(N-1)]

• Identify the desire digital filter response (e.g. HP, LP, etc.)

• Determine the mathematical representation of the digital response G(n)

SummarySummaryDesigning digital systemsDesigning digital systems

SummarySummaryDesigning digital systemsDesigning digital systems

Page 35: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

• Digitize the input analog signal into a sequence of data x(n) = [x(0), x(1), x(2), ........x(N-1)]

• Identify the desire digital filter response (e.g. HP, LP, etc.)

• Determine the mathematical representation of the digital response G(n)

• Implement the digital filter with the Generalised LTI architecture

SummarySummaryDesigning digital systemsDesigning digital systems

SummarySummaryDesigning digital systemsDesigning digital systems

Page 36: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

What is it?

It sounds simple, but something does not fit in

Page 37: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

What is it?

It sounds simple, but something does not fit in

The sequence of data x(n) = [x(0), x(1), x(2), ........x(N-1)]

seems to be unrelated to time and frequency.

Page 38: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

In fact, the data may have nothing to do with time.

e.g., the intensity of a row of pixels in an image

x(0) = 255x(1) = 255

x(2) = 128x(3) = 128

x(4) = 255x(5) = 255

x(n)= [ 255,255,128,128,255,255]

Figure 14

Page 39: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

So what is meant by frequency in the digital domain?

Page 40: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

So what is meant by frequency in the digital domain?

So what is meant by frequency in the digital domain?

Number of cycles or repetitions within a sequence of data

Page 41: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

Number of cycles or repetitions within a sequence of data.

Number of cycles or repetitions within a sequence of data.

Consider a 12 points sampling lattice

3210

-1-2-3

x(n)

n

1 cycle

Figure 15

Page 42: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

Number of cycles or repetitions within a sequence of data.

Number of cycles or repetitions within a sequence of data.

Consider a 12 points sampling lattice

3210

-1-2-3

x(n)

n

2 cycle

Figure 16

Page 43: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

Maximum number of cycles that can be represented in a sampling lattice.

3210

-1-2-3

x(n)

n

Consider a 12 points sampling lattice

Figure 17

Page 44: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

Number of cycles or repetitions within a sequence of data.

Maximum number of cycles = N/2

3210

-1-2-3

x(n)

n

Figure 18

Page 45: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

Assuming that the sampling frequency is 1 Hertz or 2radians/second

The maximum frequency that can be represented is 1/2 Hertz or radians/second

Page 46: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

Assuming that the sampling frequency is 1 Hertz or 2radians/second

The maximum frequency that can be represented is 1/2 Hertz or radians/second

The resolution in the frequency domain is 1 cycle, i.e. 1/N Hertz or 2

Page 47: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

x(n)

f

0 2N

2N

2N

2N

A typical spectrumA typical spectrum

Mirror Image

Mirror Image

Mirror Image

Figure 19

Page 48: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

• The bandwidth of any set of sequence is restricted to [0, ]

Page 49: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

• The bandwidth of any set of sequence is restricted to [0, ]

• The resolution in the frequency domain is 2 /N

Page 50: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

• The bandwidth of any set of sequence is restricted to [0, ]

• The resolution in the frequency domain is 2 /N

• All real sequences have symmetrical USB and LSB

Page 51: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

• The bandwidth of any set of sequence is restricted to [0, ]

• The resolution in the frequency domain is 2 /N

• All real sequences have symmetrical USB and LSB

• The ‘frequency’ of the sequence is relative to the sampling frequency which is taken as 1 Hz or 2 radians/second

Page 52: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

• The bandwidth of any set of sequence is restricted to [0, ]

• The resolution in the frequency domain is 2 /N

• All real sequences have symmetrical USB and LSB

• The ‘frequency’ of the sequence is relative to the sampling frequency which is taken as 1 Hz or 2 radians/second

Page 53: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

How to obtain the Spectrum from a Sequence of Data?

How to obtain the Spectrum from a Sequence of Data?

• For analog waveform, we use Fourier Transform

X j x t e dtj t( ) ( )

x t X j e dj t( ) ( )

1

2

(5)

(6)

ForwardTransform

InverseTransform

Page 54: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

How to obtain the Spectrum from a Sequence of Data?

How to obtain the Spectrum from a Sequence of Data?

• For digital sequence, we use Discrete Fourier Transform

(7)

(8)

ForwardTransform

InverseTransform

X x n e x n ekj nk N

n

Nj n

n

Nk( ) ( ) ( )/

2

0

1

0

1

x n X e X ekj nk N

k

N

kj n

k

Nk( ) ( ) ( )/

2

0

1

0

1

Nkk /2 with (9)

Page 55: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

What are ‘n’ and ‘k’?What are ‘n’ and ‘k’?

ForwardTransform

X x n e x n ekj nk N

n

Nj n

n

Nk( ) ( ) ( )/

2

0

1

0

1

n is an index to each sample of the waveform nx

3210

-1-2-3

nn=1 n=2 n=3

Page 56: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

What are ‘n’ and ‘k’?What are ‘n’ and ‘k’?

ForwardTransform

X x n e x n ekj nk N

n

Nj n

n

Nk( ) ( ) ( )/

2

0

1

0

1

k is an index to each frequency component in the spectrum kX

1

0

1

0

020

N

n

N

n

Nnj nxenxX )()()( /

Each frequency component is calculated with a value of ‘k’, e.g. The first (D.C.) component corresponds to k=0

1

0

21

0

121

N

n

NnjN

n

Nnj enxenxX // )()()(

The second component corresponds to k=1, and so on

Page 57: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

How to obtain the Spectrum from a Sequence of Data?

How to obtain the Spectrum from a Sequence of Data?

• For digital filter design, the z Transform is often used as well. (See suplementary notes)

(10)Forward zTransform

n

nznxzX )()(

Unlike Fourier Transform, there is no simple inverse transform relation for z Transform.

Page 58: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

How to obtain the Spectrum from a Sequence of Data?

How to obtain the Spectrum from a Sequence of Data?

• For digital filter design, the z Transform is often used as well

(10)Forward zTransform

n

nznxzX )()(

Unlike Fourier Transform, there is no simple inverse transform relation for z Transform.

z is a complex variable which can be represented as:z = rej

Page 59: Name: Dr. Peter Tsang Room: G6505 Ext: 7763 Email: eewmtsan@cityu.edu.hk

The basic meaning of ‘z’The basic meaning of ‘z’

r z = rej

Real

Img

Figure 20

A 2-D variable