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

DCSP-15 Jianfeng Feng Department of Computer Science Warwick Univ., UK [email protected] feng/dsp.html

  • View
    217

  • Download
    0

Embed Size (px)

Citation preview

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

DCSP-15

Jianfeng Feng

Department of Computer Science Warwick Univ., UK

[email protected]

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

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

Frequency Response of an MA filter

We can formally represent the frequency response of the filter by substituting

z = exp( j w) and obtain H( w)=A( w )

=K[(exp (-j w) – a1)…(exp (-j w) – aN)]

Consider an example

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

What is a Filter

• For a given power spectrum of a signal

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

What is a Filter

• For a given power spectrum of a signal

1Filter

Signal

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

What is a Filter

• For a given power spectrum of a signal

1Filter

Signal

*

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

What is a Filter

• For a given power spectrum of a signal

Filtered Signal

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

• Can we find a filter with a frequency response function as plotted below?

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

+ b(1) y(n-1) +…+ b(N)y(n-N)

1Filter

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

Example: Assume that

H( w)= K[(exp (-j w) – a1)(exp (-j w) – a2)]

with a1 = exp (-j / 4p ), we then have Y(w)= H( w) X( w)

and Y(w)=0 whenever w = / 4. p

Therefore, any signal with a frequency of / 4 pwill be stopped

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

h=0.01;

for i=1:314

x(i)=i*h;

f(i)=(exp(-j*x(i))-exp(-j*pi/4))*(exp(-j*x(i))-exp(j*pi/4));

end

plot(x,abs(f))

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

Moving a1 along the circle, we are able to stop a signal with a given frequency

The original difference expression can be recovered by

H( z ) = k [(z-1 – a1)(z-1 – a2)]

= k [z-2 – (a1+ a2 ) z-1 + (a1 a2 )]

y(n) = k [x(n-2) – (a1+ a2 ) x(n-1) + (a1 a2 )x(n)] =Matlab/work/simple_filger_design_ma.m

Page 11: DCSP-15 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.

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

+ b(1) y(n-1) +…+ b(N)y(n-N)

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

Transfer function

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

Block diagramX(n)

a(N)

D D

a(N-1)

+

a(0)

y(n)

+

b(N)b(N-1)

a(1)

b(1)

+ D+

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

Poles and zeros

We know that the roots an are the zeros of the transfer function.

The roots of the equation B(z)=0 are called the poles of the transfer function.

They have greater significance for the behaviour of H(z): it is singular at the points z=bn.

Poles are drawn on the z-plane as crosses, as shown in the next Fig.

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

ON this figure, the unit circle has been shown on the z-plane.

In order for a recursive filter to be bounded input bounded output

stable, all of the poles of its transfer function must lie inside the unit circle.

A filter is BIBO stable if any bounded input sequence gives rise to a bounded output sequence.

Now if the pole of the transfer lie insider the unit circle, then they represent geometric series with a coefficient whose magnitude |bm|<1, i.e. a sequence

{1, bm, (bm)2, … } which is convergent.

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

Consequently, the filter output, which is a sum of such sequences weighted by the appropriate input terms, is bounded if the input is. If, on the other hand, |bm |>1, the geometric series diverges and the filter output will grow without bound as n is large enough.

If |bm |=1, the filter is said to be conditionally stable: some input sequence will lead to bounded output sequence and some will not.

Since FR filters have no poles, they are always BIBO stable: zeros have no effect on stability.

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

Poles, Zeros and Frequency Response

Now suppose we have the ZT transfer function of a filter

We can formally represent the frequency response of the filter by substituting

z = exp( j w) and obtain H( w)= A( w ) / B( w )

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

Poles, Zeros and Frequency Response

Obviously, H( w) depends on the locations of the poles and zeros of the transfer function, a fact which ca n be made more explicit by factoring the numerator and denominator polynomials to write

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

Each factor in the numerator or denominator is a complex function of frequency, which has a graphical interpretation in the rms of the location of the corresponding root in relation to the unit circle

Thus we can make a reasonable guess about the filter frequency response imply by looking at the pole-zero diagram.

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

Filter TypesThere are four main classes of filter in widespread

use: • lowpass,• highpass, • bandpass • bandstopfilters.

The name are self-explanatory, but he extent to which the ideal frequency responses can be achieved in practice is limited.

This four types are shown in the next figure

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