7 views

Uploaded by Anas Razzaq

s

- SYSC 4405 - Quiz5b Solution
- fir filter in fpga
- Syllabus
- Digital signal processing Lab Manual
- CS 2403 — DIGITAL SIGNAL PROCESSING.pdf
- 4241
- Mitra DSP Future
- Design Filters in Simulink
- SY9324_SET1
- Untitled
- New User Manual5416 (1)
- Ees
- DSP-Chapter4 Student 11012016
- Lab DSP.pdf
- Altered DSP Complete Manual Part A
- Unesco Final
- Dsp-unit 6.2 Window Based Fir Filters
- dsp1bw
- Example 1_ Low-Pass Filtering by FFT Convolution MATLAB
- Project Review

You are on page 1of 18

HANDOUT 8.

Dr David Corrigan1 .

Electronic and Electrical Engineering Dept.

corrigad@tcd.ie www.mee.tcd.ie/corrigad

Filters

The last topic discussed was A-D conversion. This handout explores what

becomes possible when the digital signal is processed.

DSP (Digital Signal Processing) rose to signicance in the 70s and has

been increasingly important ever since. The rst enabling breakthrough

was the discovery of the Fast Fourier Transform in the last 1960s (enabling calculation of spectra on digital signals) and then the rise of the

transistor and the CPU in the 1970s and 1980s.

Its rapid rise to signicance culminated in the advent of Digital Television/Media and Mobile Communications toward the end of the 20th

century.

The study of DSP now lies somewhere between Electronic Engineering

(where it started) and Statistics, Mathematics, Computer Science and

even Statistical Physics. The computer and computing science is to DSP

engineers what the hammer and nail is to a carpenter.

In the early part of the 1990s DSP chips for implementation of DSP

algorithms were extremely popular: enabling faster computation times

than general purpose CPUs like the Intel 808x series or Motorola, SUN

or Alpha chips. But as clock speeds have increased and recongurable

hardware has developed, the lines between DSP chips, CPUs and IC

chips, have blurred.

1

This handout is based on the set of notes produced by Prof. Anil Kokaram

www.sigmedia.tv

1 DIFFERENCE EQUATION

A digital lter is a construct used in exactly the same way as an analogue

lter.

Consider the gure below showing the share price of Iona over a number

of days. This is a digital signal.

1200

400

1100

350

1000

300

900

450

250

200

150

100

700

600

500

400

50

0

0

800

300

10

20

30

40

200

0

50

20

40

60

Days

80

100

120

140

Days

To calculate the average share price over the last 10 days you could do

something like

[

]

1

yn =

xn + xn1 + xn2 + . . . xn9

10

where n is the day, xn is the share price at day n, and yn is the average

price over 10 days.

This is a digital lter called the moving average lter. It can be applied

to every day n to yield a value for the average share price over the last

10 days.

Applying this lter to the Iona signal yields the following.

450

1200

400

1000

350

300

250

200

150

800

600

400

100

200

50

0

0

10

20

30

40

50

Days

0

0

20

40

60

80

100

120

140

Days

www.sigmedia.tv

1 DIFFERENCE EQUATION

Consider what the shape of the output signal looks like compared to the

input. What is the dierence? What has been removed? The signal is

smoothed. The moving average lter is a low pass lter.

What happens if we average over more days?

[

]

1

xn + xn1 + xn2 + . . . xn(N 1)

yn =

N

1200

1200

1000

1000

800

600

400

200

0

0

800

600

400

200

20

40

60

80

100

120

0

0

140

20

40

60

Days

80

100

120

140

Days

1200

1000

800

600

400

200

0

0

20

40

60

80

100

120

140

Days

We can apply this lter N = 5, 10 to the rows of a picture to see a similar

eect.

www.sigmedia.tv

2 DIFFERENCE EQUATION

The moving average lter is an example of a dierence equation. The

dierence equation is to discrete signal processing what the dierential

equation is to analogue signal processing. This dierence equation represents a Linear Time Invariant system and obeys all the usual properties.

Given the input sequence xn = 270.2806, 257.9545, 268.2720, 272.8098, 0, 0,

calculate the output sequence yn , for n = 0 . . . 4 when xn is put through

the lter below (assume zero initial conditions).

[

]

1

yn = xn + xn1 + xn2

3

www.sigmedia.tv

2 DIFFERENCE EQUATION

[

]

1

y0 = x0 + x01 + x02

3

[

]

1

= x0 + x1 + x2

3

[

]

1

= 270.2806 + 0 + 0

3

= 90.09

[

]

1

y1 = x1 + x11 + x12

3

[

]

1

= x1 + x0 + x1

3

[

]

1

= 257.9545 + 270.2806 + 0

3

= 176.08

[

]

1

y2 = x2 + x21 + x22

3

[

]

1

= x2 + x1 + x0

3

]

[

1

= 268.2720 + 257.9545 + 270.2806

3

= 265.50

[

]

1

y3 = x3 + x31 + x32

3

[

]

1

= x3 + x2 + x1

3

[

]

1

= 272.81 + 268.2720 + 257.9545

3

= 266.34

[

]

1

y4 = x4 + x41 + x42

3

[

]

1

= 0 + 272.81 + 268.2720

3

=

3C1 Signals and Systems

www.sigmedia.tv

2.1

2 DIFFERENCE EQUATION

Impulse Response

[

]

1

yn = xn + xn1 + xn2

3

What is the impulse response of this lter? Well, just put an impulse in

and see what comes out!

xn = n = 1, 0, 0, 0, 0, . . .

[

]

1

y0 = x0 + x1 + x2

3

[

]

1

= 1+0+0

3

= 1/3

[

]

1

y1 = x1 + x0 + x1

3

= 1/3

[

]

1

y2 = x2 + x1 + x0

3

= 1/3

[

]

1

y3 = x3 + x2 + x1

3

=0

]

[

1

y4 = x4 + x3 + x2

3

=0

So the impulse response hn = (1/3), (1/3), (1/3), 0, 0, 0, . . ..

Because the impulse response has a nite duration (the non-zero values

do not last forever), this kind of lter is called a Finite Impulse Response

ler. (FIR Filter). Another way to remember this is that the output of

the lter is a function only of past inputs.

www.sigmedia.tv

In the moving average FIR lter, the values that multiply the input values

xn1 etc, are all the same. That is the coecients of the lter are all the

same.

We can generalise the idea of the moving average lter to a kind of moving

weighted average lter. For example

1

1

1

yn = xn + xn1 + xn2

4

2

4

This can be expressed as

yn =

bk xnk

k=0

In general we can write an FIR lter in that form i.e. the output is a

linear combination of past inputs. Causal FIR lter:

yn =

N

1

bk xnk

k=0

its coecients. We can see that by setting xn = n = 1, 0, 0, 0 and

working as follows.

h0 =

h1 =

h2 =

N

1

k=0

N

1

k=0

N

1

bk x0k = b0 x0 + b1 x1 + . . . = b0

bk x1k = b0 x1 + b1 x0 + . . . = b1

bk x2k = b0 x2 + b1 x1 + b2 x0 + b3 x1 + . . . = b2

k=0

www.sigmedia.tv

Recursive digital lters can be designed in which the output of the lter

depends both on current and previous inputs as well as previous outputs.

For such lters, the impulse response has innite duration and they are

called Innite Impulse Response (IIR) lters.

The general form of a causal IIR lter is as follows.

M

1

am ynm =

m=0

N

1

bk xnk

k=0

[

]

1

yn = yn1 + xn

2

(1)

Thus to calculate the current value yn given the previous value yn1 and

the new input xn , we need to calculate the previous total, and add in the

new input xn , before nding the new average by dividing by 2.

This is a recursive lter. It is an IIR lter.

www.sigmedia.tv

sequence yn , for n = 0 . . . 4 when xn is input to the lter with dierence

equation as below (assume zero initial conditions).

[

]

1

yn = yn1 + xn

(2)

2

1

1

y0 = y1 + x0

2

2

1

= 4

2

=2

1

1

y1 = y0 + x1

2

2

3

=2+

2

= 2.5

1

1

y2 = y1 + x2

2

2

= 1.25 + 1

= 2.25

1

1

y3 = y2 + x3

2

2

= 1.125 + 0.5

= 1.625

1

1

2

2

= 0.8125 + 0

y4 = y2 + x4

= 0.8125

www.sigmedia.tv

4.1

Calculate the impulse response for the system dened through the dierence equation below.

[

]

1

yn = yn1 + xn

2

Put xn = n and turn the handle.

[

]

1

yn = yn1 + xn

2

1

1

1=

2

2

1

1

+0=

2

4

1

1

+0=

4

8

1

1

+0=

8

16

1

1

+0=

16

32

1

1

=

32 64

h0 = 0 +

h1 =

h2 =

h3 =

h4 =

h5 =

1

2

1

2

1

2

1

2

1

2

hn = n+1

2

So the impulse response is hn = 21 ,

1 1

1

1

1

4 , 8 , 16 , 32 , 64 ,

...

The impulse response of an IIR lter obeys some recursive relationship

This digital IIR lter is also LTI.

10

www.sigmedia.tv

However...

It is important to note that not all recursively dened lters will be IIR.

Consider the recutsive lter

1

1

yn = yn1 + xn xn2

3

3

It has an impulse response as follows

1

1

10=

3

3

1

1

= +00=

3

3

1

1

= +00=

3

3

1

1

= +0 =0

3

3

=0+00=0

h0 = 0 +

h1

h2

h3

h4

h5 = 0

..

.

It is an FIR lter. In fact it is equivalent to the 3-tap moving average

lter from earlier.

11

www.sigmedia.tv

5 STEP RESPONSE

Step Response

Given a dierence equation, calculating the step response is done using

the same idea as with the impulse response.

Just input a step sequence and turn the handle!

Remember discrete step function un = 1, 1, 1, 1, 1, 1, 1, 1, . . .!

Also similar to the case with analogue signals, the step response is the

running sum of the impulse response.

The discrete step function un is the running sum of the discrete delta

function i.e.

n

un =

n

k=0

system, by the principles of LTI superposition , the output should be the

running sum of the system response to a discrete delta function. (i.e. the

running sum of the impulse response)

Step response gn =

hk

k=0

12

www.sigmedia.tv

5.1 Blocks

5.1

5 STEP RESPONSE

In the same way that block diagrams are useful for summarising the operation of analogue systems, block diagrams are useful for digital systems.

The main, new operator needed is a shift in time operator. This we will

denote using a box with T in it. Thus if xn is put into T out comes

xn1 . T is a delay operator and shifts the signal that is input by 1

sample.

[

]

1

yn = xn + xn1 + xn2

3

x[n]

x[n-2]

x[n-1]

T

T

1/3

1/3

1/3

y[n]

1

1

yn yn1 = xn xn3

3

3

x[n]

x[n-1]

T

x[n-2]

x[n-3]

1/3

-1/3

y[n]

+

y[n-1]

13

www.sigmedia.tv

6 DIGITAL CONVOLUTION

Digital Convolution

If we know the impulse response of an LTI system, we can calculate the response to any input using convolution. We showed

this from the principles of LTI systems way back when we were

dealing with analogue signals and systems.

The exact same thing happens for digital lters. But this time

... its alot more straightforward because everything is discrete

anyway.

The idea is the same. We can decompose xn into a sum of n

functions. Each of these then pass through the LTI system to

yield impulse responses delayed in time. The nal output is the

sum of these outputs.

14

www.sigmedia.tv

6 DIGITAL CONVOLUTION

x[n]

h[n]

3.5

3.5

2.5

2.5

1.5

1.5

0.5

0.5

0.5

0.5

1.5

4

1.5

4

10

10

x[0]h [n0]

x[0] [n0]

6

5

2

4

3

2

0

1

1

0

1

2

3

4

3

2

10

10

10

10

10

x[1]h [n1]

x[1] [n1]

6

5

2

4

3

2

0

1

1

0

1

2

3

4

3

2

10

x[2]h [n2]

x[2] [n2]

6

5

2

4

3

2

0

1

1

0

1

2

3

4

3

2

10

x[3]h [n3]

x[3] [n3]

6

5

2

4

3

2

0

1

1

0

1

2

3

4

3

2

10

15

www.sigmedia.tv

6 DIGITAL CONVOLUTION

x[0]h [n0]

x[0] [n0]

6

5

2

4

3

2

0

1

1

0

1

2

3

4

3

2

10

10

10

10

10

10

x[1]h [n1]

x[1] [n1]

6

5

2

4

3

2

0

1

1

0

1

2

3

4

3

2

10

x[2]h [n2]

x[2] [n2]

6

5

2

4

3

2

0

1

1

0

1

2

3

4

3

2

10

x[3]h [n3]

x[3] [n3]

6

5

2

4

3

2

0

1

1

0

1

2

3

4

3

2

10

x[n]

y[n]

3.5

7

3

6

2.5

5

2

4

1.5

3

1

2

0.5

1

0

0

0.5

1

1

2

1.5

4

10

16

www.sigmedia.tv

6.1

6 DIGITAL CONVOLUTION

xn .

We can express any input sequence xn as a sum of discrete delta

functions

xk kn

xn =

k=

INPUT OUTPUT

n hn

x0n x0hn

x1n1 x1hn1

x0n + x1n1 x0hn + x1hn1

xk kn

xk hnk

k=

k=

yn =

xk hnk

k=

OR

yn =

hk xnk

k=

17

www.sigmedia.tv

6 DIGITAL CONVOLUTION

Looks a lot like the statement for the FIR lter dierence equation: with bk = hk . Hence the impulse response for an FIR lter

is actually its coecients.

yn =

hk xnk

k=

superposition, associativity as convolution integral.

[xn + gn] hn = xn hn + gn hn

xn hn = hn xn

Usual simplications for causality. System response hn causal

means hn = 0for n < 0. So we can change the lower limit to 0.

yn =

hk xnk

k=0

Signal causal means that xnk = 0 for n k < 0 i.e. for k > n

so we can change the upper limit to n.

yn =

hk xnk

k=0

yn =

hk xnk

k=0

When people talk about FIR lter coecients and FIR impulse

response . . . its in fact the same thing.

18

www.sigmedia.tv

- SYSC 4405 - Quiz5b SolutionUploaded byAleksandra Diotte
- fir filter in fpgaUploaded byprkg87
- SyllabusUploaded byBharghavi Venkat
- Digital signal processing Lab ManualUploaded byLalitha Yellapu
- CS 2403 — DIGITAL SIGNAL PROCESSING.pdfUploaded byvelkarthi92
- 4241Uploaded byAravind Ramesh
- Mitra DSP FutureUploaded byeisbergeisberg
- Design Filters in SimulinkUploaded byDramane Bonkoungou
- SY9324_SET1Uploaded bykaliappan45490
- UntitledUploaded byMohit Asrani
- New User Manual5416 (1)Uploaded bynadeemp78
- EesUploaded byapi-26172869
- DSP-Chapter4 Student 11012016Uploaded byLưu Văn Hóa
- Lab DSP.pdfUploaded bylucky
- Altered DSP Complete Manual Part AUploaded bykiranthondamal
- Unesco FinalUploaded byAl Jonathan Tolentino
- Dsp-unit 6.2 Window Based Fir FiltersUploaded byMaheswara
- dsp1bwUploaded byPranav Raval
- Example 1_ Low-Pass Filtering by FFT Convolution MATLABUploaded bycejavier
- Project ReviewUploaded byVAMSIKRISHNA CHEMUDUPATI 14BEC0022
- Structures for Discrete-Time SystemsUploaded byfarsun
- Timetable 2017Uploaded bysrikanth
- Novel Method to Find the Parameter for Noise RemovalUploaded byInternational Journal of Research in Engineering and Technology
- Dsp 1Uploaded byPavan Kulkarni
- Chap6-Digital Filter StructuresUploaded byboulainine houria
- Gupta Lecture3Uploaded byRakesh Pogula
- ex1214Uploaded byreloaded63
- Leave Request StatusUploaded byanon_344622581
- EEM614-1Uploaded byMelina Andrea Ziccor
- Dsp Lab Report 01Uploaded byKitkate

- Intan Clamp Series DatasheetUploaded byAnas Razzaq
- 25820-86476-2-PB (1)Uploaded byAnas Razzaq
- 1312.7354Uploaded byAnas Razzaq
- NULL Convention Floating Point Multiplier.pdfUploaded byAnas Razzaq
- Ist Faculty Application Form (Revised) (20!03!14)Uploaded byAnas Razzaq
- Oil& GasUploaded byAnas Razzaq
- Gsm TutorialUploaded byAnas Razzaq

- Man 8055 Ord HandUploaded bysky
- 11 E60 Communication SystemsUploaded byMiloš Stijelja
- Implementation of Sub-Carrier Modulation Techniques Using MATLAB/SimulinkUploaded byIRJET Journal
- C Node Timing Source.pdfUploaded byzaabulla
- Method Analysis for the Measurement of Electromagnetic Field From Lte Base StationsUploaded byIJSTR Research Publication
- 4G LTE.pdfUploaded bygjfjgjmgmj
- IVyr_EIUploaded byRahul Sakarey
- Tandberg Trc4 Remote Control Quick Reference GuideUploaded bygreyj
- Radio Ampstik 6-120 ManualUploaded byLuis Ibañez
- Carrier Sense Multiple AccessUploaded byUmamageswari Kumaresan
- Assignment 1 VLSIUploaded byarafatasghar
- Internship ReportUploaded byAreeba Ayzaz
- Ericsson Business Phone 50 PDFUploaded byGladys
- Documento Protocolos ABUploaded byRamon Almonte Perez
- IEEE802Uploaded bynishasaiyed2304
- 09362 16 Vesda Vlc Tds a4 Ie LoresUploaded byEduardo Parrudo
- Wireless Mobile Bomb Disposal Unit (2)Uploaded byPiyush Kumar
- 11FM1036C - TTX1994 datasheetUploaded bygkruet77
- LED DisplayUploaded byYellasiri Suresh
- VMN-PL0332-1202Uploaded byalexns84
- DB499-K (1)Uploaded bylewis_josey
- RC-1976-07Uploaded byJan Pran
- Operating Manual (Avh p8450bt) EngUploaded byVictor Briceno
- Viewsonic VG2439SmhUploaded bymatteo_1234
- EE100B Lab 3 ReportUploaded byTina Nguyen
- Automatic Sensor Bridge ProjectUploaded byNarayanan Kumar
- IJETR031356Uploaded byerpublication
- Mc275mk5 BroUploaded byjamocas
- Challenges in Implementing DDR3Uploaded byBharat G Hegde
- ELEC50B Test 1 Study QuestionsUploaded byArjunLohan