4 views

Uploaded by gsavithri_4017

© All Rights Reserved

- Com Sym
- Control Strategies for Crane Systems a Comprehensive Review_2017
- Dsp Manual
- Chapter 7 IIR Filters
- bx_boom Manual.pdf
- Design and Analysis of Integrator-Based Log-Domain Filter Introduction
- Digital Signal Processing (Dsp)
- cepstrum
- 5-Digital Filters - IIR
- Etm 4096 Digital Signal Processing-1
- Fir
- qp__ece_32_may2010_dsp
- 6
- DSP-6 (FIR) (S)
- InTech-On Design of Cic Decimators
- Unit 1 Introduction to Digital Signal Processing
- MC-CDMA
- Session9 DSP
- 11advanced Peripherals Ch 006 Ds0011 Sound to Light III
- Fault recovery using scan chain based approach technique.pdf

You are on page 1of 24

Chapter 15, Slide 2

Learning Objectives

Introduction to the theory behind IIR

filters:

Properties.

Coefficient calculation.

Structure selection.

Implementation in Matlab, C and linear

assembly.

Chapter 15, Slide 3

Introduction

Infinite Impulse Response (IIR) filters are

the first choice when:

Speed is paramount.

Phase non-linearity is acceptable.

IIR filters are computationally more

efficient than FIR filters as they require

fewer coefficients due to the fact that they

use feedback or poles.

However feedback can result in the filter

becoming unstable if the coefficients

deviate from their true values.

Chapter 15, Slide 4

Properties of an IIR Filter

The general equation of an IIR filter can

be expressed as follows:

( )

+

=

+ + +

+ + +

=

M

k

k

k

N

k

k

k

M

M

N

N

z a

z b

z a z a

z b z b b

z H

1

0

1

1

1

1 0

1

1

a

k

and b

k

are the filter coefficients.

Chapter 15, Slide 5

Properties of an IIR Filter

The transfer function can be factorised to

give:

()

( )( )( )

( )( )( )

()

() z X

z Y

p z p z p z

z z z z z z

k z H

N

N

=

=

2 1

2 1

Where: z

1

, z

2

, , z

N

are the zeros,

p

1

, p

2

, , p

N

are the poles.

Chapter 15, Slide 6

Properties of an IIR Filter

The transfer function can be factorised to

give:

()

( )( )( )

( )( )( )

()

() z X

z Y

p z p z p z

z z z z z z

k z H

N

N

=

=

2 1

2 1

For the implementation of the above

equation we need the difference equation:

|| ||| |

| | | |

= =

=

=

=

M

k

k

N

k

k

k

k n y a k n x b

k n x k h n y

1 0

0

Chapter 15, Slide 7

Properties of an IIR Filter

|| ||| | ||| |

= =

+ =

M

k

N

k

k n y k a k n x k b n y

1 0

x(n)

+ b

0

+ b

1

+ b

2

+

+

+

a

1

a

2

z

-1

y(n)

z

-1

z

-1

z

-1

IIR Equation

IIR structure for N = M = 2

Chapter 15, Slide 8

Design Procedure

To fully design and implement a filter five

steps are required:

(1) Filter specification.

(2) Coefficient calculation.

(3) Structure selection.

(4) Simulation (optional).

(5) Implementation.

Chapter 15, Slide 9

Filter Specification - Step 1

(a)

1

f(norm)

fc : cut-off frequency

pass-band stop-band

pass-band stop-band transition band

1

s

o

pass-band

ripple

stop-band

ripple

fpb : pass-band frequency

fsb : stop-band frequency

f(norm)

(b)

p

1 o +

s

A

p

A

0

-3

p

1 o

fs/2

fc : cut-off frequency

fs/2

|H(f)|

(dB)

|H(f)|

(linear)

|H(f)|

Chapter 15, Slide 10

Coefficient Calculation - Step 2

There are two different methods available

for calculating the coefficients:

Direct placement of poles and zeros.

Using analogue filter design.

Both of these methods are described.

Chapter 15, Slide 11

Placement Method

All that is required for this method is the

knowledge that:

Placing a zero near or on the unit circle in

the z-plane will minimise the transfer

function at this point.

Placing a pole near or on the unit circle in

the z-plane will maximise the transfer

function at this point.

To obtain real coefficients the poles and

zeros must either be real or occur in

complex conjugate pairs.

Chapter 15, Slide 12

Placement Method

Example - Placement method:

Link: \Links\zeropole.exe

Chapter 15, Slide 13

Analogue to Digital Filter Conversion

This is one of the simplest method.

There is a rich collection of prototype

analogue filters with well-established

analysis methods.

The method involves designing an

analogue filter and then transforming it to

a digital filter.

The two principle methods are:

Bilinear transform method

(\Links\Bilinear Theory.pdf).

Impulse invariant method.

Chapter 15, Slide 14

Bilinear Transform Method

Practical example of the bilinear

transform method:

The design of a digital filter to approximate a

second order low-pass analogue filter is

required.

The transfer function that describes the

analogue filter is:

The digital filter is required to have:

Cut-off frequency of 6kHz.

Sampling frequency of 20kHz.

()

1 2

1

2

+ +

=

s s

s H

Chapter 15, Slide 15

Bilinear Transform Method

Matlab code for calculating coefficients:

a = tan(pi*2/8) % cut-off 2kHz, fsample 8 kHz, input < 580 mVpp

b = (1 + 2^0.5 + (a*a))

b00 = (a*a)/b

b01 = 2*b00

b02 = b00

a01 = 2*(a^2 -1)/b

a02 = (1 + a^2 - (2^0.5)*a)/b

bb = [b00 b01 b02];

aa = [1 a01 a02];

figure(1)

freqz(bb,aa,512,8000)

fid = fopen('IIR_coef_float.txt', 'w');

fprintf(fid,'%0.4f,%0.4f,%0.4f\n',bb);

fprintf(fid,'%0.4f,%0.4f\n',aa);

fclose(fid);

Chapter 15, Slide 16

Bilinear Transform Method

Output from Matlab code:

bb = [0.2929, 0.5858, 0.2929]

aa = [1, --1.3007e-016, 0.1716]

Converting these to Q15 format we get:

b = (bb * 2

15

)

HEX

= [0x257D, 0x4AFB, 0x257D]

a = (bb * 2

15

)

HEX

= [0x7FFF, 0x0, 0x15F6]

Note that 1 ~ (0x7FFF)

DEC

Chapter 15, Slide 17

Realisation Structures - Step 3

Direct Form I:

()

()

()

M

M

N

N

M

k

k

k

N

k

k

k

z a z a

z b z b b

z a

z b

z X

z Y

z H

=

+ + +

+ + +

=

+

= =

1

1

1

1 0

1

0

1

1

Difference equation:

|| | | | |

= =

=

M

k

k

N

k

k

k n y a k n x b n y

1 0

This leads to the following structure

Chapter 15, Slide 18

Realisation Structures - Step 3

Direct Form I:

x(n)

+ b

0

+ b

1

+ b

2

+ b

N-1

+ b

N

+

+

+

+

+

a

1

a

2

a

M-1

a

M

z

-1

y(n)

z

-1

z

-1

z

-1

z

-1

z

-1

Chapter 15, Slide 19

Realisation Structures - Step 3

Direct Form II canonic realisation:

() () ()

()

()

()

() z P

z Y

z X

z P

z b

z a

z H z H z H

N

k

k

k

M

k

k

k

=

=

+

= =

M N for ;

1

1

0

1

2 1

Where:

()

()

()

()

=

+

=

N

k

k

k

M

k

k

k

z b

z P

z Y

z a

z X

z P

0

1

and

1

1

() ( )

=

=

N

k

k

k n p b n y

0

() () ( )

=

=

N

k

k

k n p a n x n p

1

Taking the inverse of the z-transform of

P(z) and Y(z) leads to:

Chapter 15, Slide 20

Realisation Structures - Step 3

Direct Form II canonic realisation:

+ b

0

+ b

1

z

-1

+ b

2

+ b

N

-a

1

-a

2

-a

N

+

+

+

+

y(n) x(n) P

(n)

z

-1

z

-1

P

(n-1)

P

(n-2)

P

(n-N)

Chapter 15, Slide 21

Implementation - Step 5

void IIR_Isr (void)

{

short a1 = 0x0;

short a2 = 0x15f6;

short b0 = 0x257d;

short b1 = 0x4afd;

short b2 = 0x257d;

static short d01=0, d02=0, d00;

short xn, y0;

int prod1, prod2, prod3, prod4, prod5, input, output;

input = mcbsp0_read(); // Read the input sample from the serial port

y0 = 0;

input &= 0xffff;

xn = (short) (input & 0x000ffff);

prod1 = _mpy(d02,a2)>>15;

prod2 = _mpy(d01,a1)>>15;

d00 = xn + (short)(prod1 + prod2);

prod3 = _mpy(d01,b1);

prod4 = _mpy(d02,b2);

prod5 = _mpy(d00,b0);

y0 = (short)((prod3+prod4+prod5)>>15);

d02 = d01;

d01 = d00;

output = y0;

mcbsp0_write(output& 0xfffffffe); // Write the signal to the serial port

return;

}

C code

Chapter 15, Slide 22

Implementation - Step 5

.def _iir_sa

.sect "mycode"

_iir_sa .cproc an1, an2, bn0, bn1, bn2, delays, x_ptr, y_ptr,mask, mask2

.reg p0, p1, p2

.reg prod1, prod2, prod3, prod4, prod5

.reg sum1, sum2, sum3

.reg x, ref, y0,y1

LDW *x_ptr, x

AND x,mask,x

LDH *+delays[0], p1

LDH *+delays[1], p2

MPY an1, p1, prod1

MPY an2, p2, prod2

ADD prod1, prod2, sum1

SHR sum1, 15, sum1

ADD x, sum1, p0

MPY bn0, p0, prod3

MPY bn1, p1, prod4

MPY bn2, p2, prod5

ADD prod4, prod5, sum2

ADD prod3, sum2, sum3

SHRU sum3, 15, y0

STH p1, *+delays[1]

STH p0, *+delays[0]

AND y0, mask2, y0

STW y0, *y_ptr

.return y0

.endproc

Linear assembly

code

Chapter 15, Slide 23

IIR Code

Code location:

Code\Chapter 15 - Infinite Impulse Response Filters

Projects:

Fixed Point in C: \IIR_C_Fixed\

Fixed Point in Linear Asm: \IIR_Sa_Fixed\

Chapter 15

Infinite Impulse Response (IIR) Filters

- End -

- Com SymUploaded byTrooperx22
- Control Strategies for Crane Systems a Comprehensive Review_2017Uploaded byoscar201140
- Dsp ManualUploaded bySuchithara
- Chapter 7 IIR FiltersUploaded byМилошМитић
- bx_boom Manual.pdfUploaded bypapardellas
- Design and Analysis of Integrator-Based Log-Domain Filter IntroductionUploaded byyecheng
- Digital Signal Processing (Dsp)Uploaded bywww.bhawesh.com.np
- cepstrumUploaded byapi-3832844
- 5-Digital Filters - IIRUploaded bysebastian nasi
- Etm 4096 Digital Signal Processing-1Uploaded byIsabelle N Kijjambu
- FirUploaded bySowjanya Sowji
- qp__ece_32_may2010_dspUploaded byAnji Badugu
- 6Uploaded byअमरेश झा
- DSP-6 (FIR) (S)Uploaded byJyothi Jo
- InTech-On Design of Cic DecimatorsUploaded byVitu Vitu
- Unit 1 Introduction to Digital Signal ProcessingUploaded byPreetham Saigal
- MC-CDMAUploaded bymitsuosakamoto
- Session9 DSPUploaded byrktiwary256034
- 11advanced Peripherals Ch 006 Ds0011 Sound to Light IIIUploaded byJohn Walter Ticona Quispe
- Fault recovery using scan chain based approach technique.pdfUploaded byiaetsdiaetsd
- SOP-2-EE.docUploaded bySheraz Ahmed
- Voice_CS COUNTERS.pdfUploaded byJoseph Ogundiran
- 6097.EL3004(Digital Signal Processing) (1)Uploaded byAshish Choudhary
- Ieee EcticonUploaded byAmbika Prasad Chanda
- Stratix HandbookUploaded byПавел Карпович
- 180615 Vse 2 Plugin ManualUploaded byConst Vass
- RestorationUploaded byFatoma Elamora
- A_07-DSPUploaded byprasad
- SamplingUploaded bychirayus_3
- 04542062Uploaded bycastilho22

- Questions and AnswersUploaded byRamesh
- fpga tutorialUploaded bygsavithri_4017
- fpga_faqsUploaded bygsavithri_4017
- April - 2015.pdfUploaded bygsavithri_4017
- FULLTEXT01.pdfUploaded bygsavithri_4017
- vocab.pdfUploaded byPETER
- SDR for engineeringUploaded byTariq
- wireless posterUploaded bygsavithri_4017
- WiFiRangeDemystifiedCompanionGuideUploaded byMairaj Uddin
- ew-quick-guide-pdf.pdfUploaded bygsavithri_4017
- DSP or FPGA How to Choose the Right DeviceUploaded bygsavithri_4017
- fil1Uploaded bygsavithri_4017
- 10Uploaded bygsavithri_4017
- Practical-Guide-to-Build-the-Electronics-Projects.pdfUploaded bygsavithri_4017
- 306960141 Manual Analizador de EspectrosUploaded bygamer08
- Understanding Modern Digital Modulation TechniquesUploaded bygsavithri_4017
- Full Text 01Uploaded bygsavithri_4017
- apbppt-151203045605-lva1-app6892Uploaded bygsavithri_4017
- CdcUploaded byjoenj
- mail_glass.pdfUploaded bygsavithri_4017
- Chipshop Mail GlassUploaded bygsavithri_4017
- Questions on Logic SynthesisUploaded byrAM
- CanteenQuestionnaire2009 PrintUploaded byshaminibinoy
- Academic Year Planner 2014 2015Uploaded bygsavithri_4017
- planner 2014Uploaded byMuhamad Ezrin Ishak
- 2014-10-octoberUploaded bygsavithri_4017
- ASIC IC Design for Test Process GuideUploaded bydkadao

- PUAHistChemFormulate by DudleyUploaded bypuja_14
- A Cdc Module Users GuideUploaded byRaturi Deepankar
- CVNG 2005 May 2009 Shrivastava and Chadwick ModifiedUploaded byrajal11
- tij1o0 electronic game board wiring and soldering rubric fall 2017Uploaded byapi-308067286
- Technical-article-Comparative-evaluation-of-steel-profiles-in-roof-trusses.pdfUploaded byRenzo Matias
- Mukherjee09Uploaded bySaber Rezgui
- Flyer VisoTurb 900PUploaded byleonardo
- Calculus 08 Techniques of IntegrationUploaded bykumar830
- NS107S-SA RGB Pixel LED datasheetUploaded byJason Gong
- i3vlo.gravitational.systems.of.Groundwater.flow.Theory.evaluation.utilizationUploaded byAnonymous yDrLHxP9
- ReadmeSupplement_v65.pdfUploaded byktsnl
- S. SircarUploaded bylorencorumba
- internshipreport Aatif.docxUploaded byAatif
- Sample and HoldUploaded byweightless765590
- Analysis of PEKA 1-Chem f4Uploaded byZalilahismail Ismail
- Time HistoryUploaded byshivamomshanti
- Seismic performance of concrete-shear-wall buildings in IndiaUploaded byMohamed
- 157309 November 2012 Question Paper 23Uploaded byAntonique Headman
- Hollow EarthUploaded byBrittany Mayer
- QMIN13-GLM_MultivariateUploaded byEmad R. H. Issak
- LDM Y LCUploaded byGloria Mejia
- Noise Reduction Technique using Bilateral Based FilterUploaded byIRJET Journal
- Texture segmentationUploaded byG.m. Raja
- Masonry Arches Historical Rules and Modern MechanicsUploaded byPedro Silva
- Wave Characteristics and Periodic Motion Test w. SolutionsUploaded byNatalie Gukasyan
- Maths 3 syllabusUploaded byShashwat Tripathi
- Modelling-the-mechanical-properties-of-concrete-c_2017_Construction-and-Buil.pdfUploaded byAniel Dias
- Semyon Davidovich KirlianUploaded byRishikhant
- ASHRAE-Chart2.pdfUploaded byalialavi2
- Lesson3 - Understanding EnergyUploaded byCaranto Lois Caranto