DCSP-14 Jianfeng Feng Department of Computer Science Warwick Univ., UK [email protected]...

23
DCSP-14 Jianfeng Feng Department of Computer Science Warwick Univ., UK [email protected] http://www.dcs.warwick.ac.uk/ ~feng/dsp.html

Transcript of DCSP-14 Jianfeng Feng Department of Computer Science Warwick Univ., UK [email protected]...

Page 1: DCSP-14 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

DCSP-14

Jianfeng Feng

Department of Computer Science Warwick Univ., UK

[email protected]

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

Page 2: DCSP-14 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

How to deal with noise?How to transmit signals?

Page 3: DCSP-14 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

Filter

a filter is a device or process that removes from a signal some unwanted component or feature.

Filtering is a class of signal processing, the defining feature of filters being the complete or partial suppression of some aspect of the signal.

Most often, this means removing some frequencies and not others in order to suppress interfering signals and reduce

background noise.

Page 4: DCSP-14 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

Filter

y(n) = a0x(n)+a1x(n-1)+…+aNx(n-N)

+b1y(n-1)+…+bNy(n-N)

Nth order filter

Page 5: DCSP-14 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

Filter

y(n) = a0x(n)+a1x(n-1)+…+aNx(n-N)

+b1y(n-1)+…+bNy(n-N)

Nth order filter

signal

Page 6: DCSP-14 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

Example

y(n) = [ x(n)+ … x(n-N) ] / N

In this case, when bi=0, it is an MA filter (averaging

of input signals)

In general it is called ARMA filter.

Page 7: DCSP-14 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

Purpose

To find the coefficient a’s and b’s for certain purposes:

For example, filter out noise, stop certain band signals, allow certain band signal to pass etc.

Page 8: DCSP-14 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

Example

w=y+.1*randn(length(y),1);for i=10:length(y) z(i)=(w(i)+w(i-1)+w(i-2)+w(i-3)+w(i-4)+w(i-

5)+w(i-6)+w(i-7)+w(i-8)+w(i-9))/10;end sound(z) sound(w)

Page 9: DCSP-14 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

{y(n)} = a0{x(n)}+a1{x(n-1)}+…+aN{x(n-N)}

+b1{y(n-1)}+…+bN{y(n-N)}

Multiplying z-n on both size of the equation above

where z is a complex number and summing over

n

Y(z) = a0X(z)+a1z-1X(z)+…+aNz-NX(z)

+b1z-1Y(z)+…+bNz-NY(z)

Y(z)-( b1 z-1 Y(z) +… + bN z-N Y(z))

= a0 X(z) + a1 z-1 X(z) +…+ aN z-NX(z)

Page 10: DCSP-14 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

[1-b1z-1-…- bN z-N ] Y(z)

= [ a0+ a1 z-1 +… + aN z-N ] X(z)

Y(z) ={ [ a0+a1z-1+…+aNz-N ] / [1-b1z-1-…-bNz-N] }

X(z)

= H(z) X(z)

H(z) is usually called transfer function:it characterizes the input output relationship of a filter

Page 11: DCSP-14 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

Nonrecursive FiltersWhen a filter is nonrecursive, its difference equation can be

written

y(n) = a0 x(n) + a1 x(n-1) +…+ aN x(n-N)

Such filters are also called finite impulse response filters, for the obvious reason that their IR contain only finitely many nonzero terms.

Correspondingly, the ZT of a nonrecursive filter can be written as

a

Page 12: DCSP-14 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

Block diagram

Page 13: DCSP-14 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

z

Sometime we use h=a

Page 14: DCSP-14 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

Example

Page 15: DCSP-14 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

Three types of representation

• Linear difference equation

• Block diagram

• Transfer function

Page 16: DCSP-14 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

Trying to figure out how an FIR filter will behave, is not always so simple.

Page 17: DCSP-14 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

Trying to figure out how an FIR filter will behave, is note always so simple.

Another way of looking at it is through its frequency domain behaviors.

Page 18: DCSP-14 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

Trying to figure out how an FIR filter will behave, is note always so simple.

Another way of looking at it is through its frequency domain behaviors.

We can make a start on this by examining the zeros of its transfer function H(z), i.e. those values of z for which

H(z)=0 since H(z) is a polynomial of order N with real

coefficients,

Page 19: DCSP-14 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

Trying to figure out how an FIR filter will behave, is note always so simple.

Another way of looking at it is through its frequency domain behaviors.

We can make a start on this by examining the zeros of its transfer function H(z), i.e. those values of z for which

H(z)=0 since H(z) is a polynomial of order N with real

coefficients,

It follows that the equation has N roots, which are either real or occur in complex conjugate pairs.

Page 20: DCSP-14 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

We can express H(z) in terms of the roots by writing

where in general

zm= |zm| exp ( j arg [zm] )

is the mth root, or zero of the transfer function.

The zeros of a transfer function are usually denoted graphically in the complex z-plane by circles, as shown in the following Fig.

1

( ) ( )N

Nm

m

z H z z z

Page 21: DCSP-14 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

We can express H(z) in terms of the roots by writing

where in general

zm= |zm| exp ( j arg [zm] )

is the mth root, or zero of the transfer function.

1

( ) ( )N

Nm

m

z H z z z

Page 22: DCSP-14 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.
Page 23: DCSP-14 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

Recursive Filters

Of the many filter transfer function which are not FIR, the most commonly use in DSP are the recursive filters, so called because their current output depends not only on the last N inputs but also on the last N outputs.