Top Banner
DSP—Revision I http://www.dcs.warwick.ac.uk/~feng /dsp.html
25
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: DSPRevision I feng/dsp.html.

DSP—Revision I

http://www.dcs.warwick.ac.uk/~feng/dsp.html

Page 2: DSPRevision I feng/dsp.html.

Content• 1. Sequences and their representation • 2. Digital Filters• 3. Nonrecursive Filters• 4. Recursive Filters• 5. Frequency and digital filters• 6. Sampling and reconstruction• 7. Signal correlation and matched filters• 8. Dealing with noise• 9. Data compression• three weeks on FFT etc.• 10. Image feature extraction• 11. Image enhancement

Page 3: DSPRevision I feng/dsp.html.

2.3 Filters

General form

N

m

mm

N

m

mm

N

m

mm

N

m

mm

N

m

mm

N

m

mm

zb

za

zX

zYzH

zXzazYzb

nyDbnxDany

1

0

01

10

)1()(

)()(

)()()1(

)()()(

H is called the transfer function of the filter

Page 4: DSPRevision I feng/dsp.html.

4.3 Poles and zeros

kz

z

zH

m

nn

m

nn

1

1

N-1-

-N-1

)(

)(

b(N)zb(1)z-1

a(N)za(1)za(0))(

n is called poles, n is zeros

Page 5: DSPRevision I feng/dsp.html.

xzero

x

pole

A filter is fully determined by its poles and zeros

Page 6: DSPRevision I feng/dsp.html.

4.6 Three domains of representation

1. Time domain representation

Hx(n) y(n)

y(n)= b(1)y(n-1)+…+b(N)y(n-N) +a(0)x(n)+a(1)x(n-1)+…+a(N)x(n-N)

Page 7: DSPRevision I feng/dsp.html.

2. z--domain representation

))...((

))...((

)(...)1(

)(...)1()0()(

1

11

1

N

NNN

NN

zz

zzK

Nbzbz

NazazazH

K

1

x

X

1

2

2

3

Page 8: DSPRevision I feng/dsp.html.

3. frequency--domain representation

H()=H(z)|z=exp(j

|H()|

phase

Page 9: DSPRevision I feng/dsp.html.

ExampleTime: y(n)-y(n-1)+0.5y(n-2)=3x(n)-2x(n-1)

Z-domain: H(z)=(3-2z-1)/(1-z-1+0.5z-2)

= (3z2-2z)/(z2-z+0.5)

Zeros: 0, 2/3

Poles: 1/1.414 exp(j pi/4), 1/1.414 exp(-j pi/4)

It is BIBO stable

Frequency-domain:

Page 10: DSPRevision I feng/dsp.html.

Principle of filter design

1. We specify what the filter passes (the sign) and stop (the disturbance) in the frequency domain

2. Then we determine poles and zeros in the z-domain from the passband and the stopband

3. Finally, the filter is implemented recursively by the difference equation in the time domain

Page 11: DSPRevision I feng/dsp.html.

We can see that if the signal x(t) is bandlimited, in the sense that X(F)=0 for |F|>FB, for some frequency FB called the bandwidth of the signal, and we sample at a frequency Fs>2FB, then there is no overlapping between the repetitions on the frequency spectrum. In other words, if Fs>2FB,

Xs(F)=FsX(F) in the interval –Fs/2<F<Fs/2

And X(F) can be fully recovered from Xs(F). This is very important because it states that the signal x(t) can be fully recovered from its samples x(n)=x(nTs), provided we sample ‘fast enough’ (meaning Fs>2FB)

Page 12: DSPRevision I feng/dsp.html.

6.2.1 downsampling

(… x(-2) x(-1) x(0) x(1) x(2) ….)

(… y(-1) y(0) y(1) … )

)(2

1)(

2

1

))(12(2

1))(12(

2

1))(2(

))(12(2

1))(12(

2

1))(2(

))(2()2()()(

12122

12122

2

zXzX

zkxzkxzkx

zkxzkxzkx

zkxzkxzkyzY

k

k

k

k

k

k

k

k

k

k

k

k

k

k

k

k

k

k

Page 13: DSPRevision I feng/dsp.html.

6.2.2 Upsampling

(… x(-1) x(0) x(1) ….)

(… y(-2) 0 y(0) 0 y(2) … )

)(

))(()()()(

2

22

zX

zkxzkxzkyzYk

k

k

k

k

k

Page 14: DSPRevision I feng/dsp.html.

Example: Haar wavelet

Definition 1 (The Haar scaling function)   Let H be defined by H(t)=1, 0<t<=1, and 0 elsewhere

12,...1,0,...,1,0),2(2)(, jjjji ijitHtH

The index j refers to dilation and i refers to translation

Page 15: DSPRevision I feng/dsp.html.

Haar wavelet transform of a signal

...

3,23,22,22,21,21,20,20,2

1,11,10,10,1

0,00,00,00,0

GGfGGfGGfGGf

GGfGGf

GGfHHff

For any f as function in [0,1]. The decomposition is unique since {Gi,j} is orthogonal, and it forms a basis in L2

Page 16: DSPRevision I feng/dsp.html.

7.2 Correlation

)()()(

)()(

)()()(

nrnmxmx

mxnmx

mxmnhny

xxk

k

k

Page 17: DSPRevision I feng/dsp.html.

Its Z transform is

R(z)=X(z)X(z-1)

auto-correlation function

In general we have

cross-correlation function

R(z)=X(z)Y(z-1)

n

xy nmymxnR )()()(

Page 18: DSPRevision I feng/dsp.html.

8.1.3 Gaussian variables

Mean=, variance=

x=(…x(-2),x(-1),x(0),x(1),x(2),…) each of them is a Gaussian variable, then

is again a normal random variable with a mean and variance.

2

2

2

)(exp

2

1)(

x

xp

n

nxnhxh )()(

Page 19: DSPRevision I feng/dsp.html.

W(n)=x(n)+v(n)

Assume we know the signal sequence

x(1), x(2), ….,x(N)

How to design a filter so that we can detect the presence of the signal?

There are many ways to do it. The simplest and classical one is called

linear correlation detector.

Page 20: DSPRevision I feng/dsp.html.

9.3.1 Wiener Filter

Signal x

Received signal y=x+n

Minimize E(x-ay)^2 to find that

yEy

ENEyy

ENEx

Exayx

ENEx

Exa

2

22

22

2

22

2

Page 21: DSPRevision I feng/dsp.html.

Concentrating on transform coding

• Distributed multimedia

• JPEG, MPEG

• Using discrete cosine transform (DCT), a special case of DFT

Page 22: DSPRevision I feng/dsp.html.

10. Feature extraction

10.1 Matched filter

10.2 Gradient estimation

10.2 Local transforms

Page 23: DSPRevision I feng/dsp.html.

11. Enhancement

11.1 Contrast enhancement

11.2 Deblurring

11.3 Denoising

Page 24: DSPRevision I feng/dsp.html.

11.1 Contrast enhancement

• Histogram Equalization

                                                                                                

Note how the image is extremely grey; it lacks detail since the

Page 25: DSPRevision I feng/dsp.html.

Example

Let x(i) be Gaussian random variables with mean zero and variance 1, and

y(n)= sin(n/2)x(n)+ sin((n-1)/2)x(n-1)+ sin((n-2)/2)x(n-2)+sin((n-3)/2)x(n-3)

Find Ey(n), E(y(n)-Ey(n))2, and the distribution of y(n)