/
A Discrete-Time Signal Processing Framework A Discrete-Time Signal Processing Framework

A Discrete-Time Signal Processing Framework - PowerPoint Presentation

calandra-battersby
calandra-battersby . @calandra-battersby
Follow
345 views
Uploaded On 2019-06-29

A Discrete-Time Signal Processing Framework - PPT Presentation

Dr Veton K ë puska 5 October 2017 Veton Këpuska 2 Introduction DiscreteTime Signals 5 October 2017 Veton Këpuska 4 DiscreteTime Signals Signals in nature are defined by their continuously varying values ID: 760775

veton 2017 october puska 2017 veton puska october time discrete filter system signals signal 127 32767 2147483647 systems linear

Share:

Link:

Embed:

Download Presentation from below link

Download Presentation The PPT/PDF document "A Discrete-Time Signal Processing Framew..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Slide1

A Discrete-Time Signal Processing Framework

Dr. Veton K

ë

puska

Slide2

5 October 2017

Veton Këpuska

2

Introduction

Slide3

Discrete-Time Signals

Slide4

5 October 2017

Veton Këpuska

4

Discrete-Time Signals

Signals in nature are defined by their continuously varying values.

The resulting analog (continuous) waveform is typically denoted by

x(t)

.

x(t)

continuous-time

signal or

analog waveform

On the other hand, discrete-time (DT) signals are, as the name implies, values that exists only at specific and discrete instances of time.

Definition:

Discrete Time Signals are functions (real or complex – valued) of an integer-valued independent variable, n, which is called “sample index” or “Discrete Time index”.

The resulting discrete time signals are denoted by

x

[n]

.

A signal is indicated as a lower case letter:

x

Signal Name

x

[n]

n’th sample of Discrete Time Signal

Slide5

5 October 2017

Veton Këpuska

5

Examples of Discrete Time Signals

If x[n]=n

2

, the 2nd sample of x is x[2]=22=4.

This form is called a “piece-wise” or “branch” definition of a signal.

Slide6

5 October 2017

Veton Këpuska

6

Discrete Sequences & Graphical Representation

Figure 2.1

Graphical representation of a discrete-time signal.

From

Discrete-Time Signal Processing

, 2e

by Oppenheim, Schafer, and Buck ©1999-2000 Prentice Hall, Inc.

Slide7

5 October 2017

Veton Këpuska

7

Matlab Stem Function

Slide8

5 October 2017

Veton Këpuska

8

Discrete-Time Signals

In the realm of Digital Signal Processing a limited number of types of signals are used due to their specific properties.

In the next section those signals are introduced.

Each signal will be defined analytically as well as its graphical representation will be given.

Slide9

5 October 2017

Veton Këpuska

9

0

Special Types of Discrete Signals

Unit Impulse/Sample

[n]

n

-3

-2

-1

1

2

3

1

Slide10

5 October 2017

Veton Këpuska

10

Special Types of Discrete Signals

Note: The unit impulse/sample  takes the value of 1 whenever its argument (contained in []) becomes zero.Example:

Slide11

5 October 2017

Veton Këpuska

11

1

n

1

2

3

Special Types of Discrete Signals

Unit Step

0

u

[n]

-3

-2

-1

Slide12

5 October 2017

Veton Këpuska

12

Special Types of Discrete Signals

Note: The unit step u takes the value of 1 whenever its argument (contained in []) is greater and equal to zero.Example:

Slide13

Unit step sequence and unit sample can be expressed as a function of the other:

5 October 2017

Veton Këpuska

13

Slide14

5 October 2017

Veton Këpuska

14

-1

1

n

1

2

3

Special Types of Discrete Signals

Unit Ramp

0

r

[n]

-3

-2

Slide15

5 October 2017

Veton Këpuska

15

Special Types of Discrete Signals

Note: Unit ramp function r[n] can be expressed as function of unit sample function

r

[

n

]=

nu

[

n

]

Slide16

5 October 2017

Veton Këpuska

16

Special Types of Discrete Signals

Exponential FunctionNote: The “shape” of the exponential signal dependents on the || and its sign||.If ||<1 then

Slide17

5 October 2017

Veton Këpuska

17

Special Types of Discrete Signals

n

-1

1

1

2

3

0

r

[

n

]

-3

-2

>1

n

-1

1

1

2

3

0

r

[

n

]

-3

-2

0<

<1

Slide18

5 October 2017

Veton Këpuska

18

Special Types of Discrete Signals

n

-1

1

1

2

3

0

r

[n]

-3

-2

<-1

n

-1

1

1

2

3

0

r

[n]

-3

-2

-1<

<0

Slide19

5 October 2017

Veton Këpuska

19

Periodic Discrete-Time Signals

Periodicity of Discrete-Time Signals vs. Continuous Signals:Continuous Signals:Discrete-Time Signals: A signal x is said to be periodic with period of N≠0 (we assume that N>0) if only if

Slide20

5 October 2017

Veton Këpuska

20

Periodic Discrete-Time Signals

Notes:

It is necessary for

N

0,

otherwise all signals would be periodic.

If x is periodic with period of

N

, then it is also periodic with period of 2

N

, 3

N

, etc.

Definition: The smallest integer period of a periodic signal is called “fundamental period” of the signal.

Example

x

[n] = (-1)

n

,

n: periodic with fundamental period of N=2

x

[n] = u[n], : a-periodic signal

Slide21

5 October 2017

Veton Këpuska

21

Periodic Discrete-Time Signals

Interesting Facts:Let x and y be two periodic signals with fundamental period N and M respectively.If z[n]=x[n]∓y[n] or z[n]=x[n]y[n] or z[n]=x[n]/y[n] (y[n]≠0, ∀n) Then z[n] is periodic with fundamental period of least common multiple LCM(N,M).LCM(N,M) is computed as:

Slide22

5 October 2017

Veton Këpuska

22

Formal Definitions of LCM & GCD

Definition 1

We say that “

d

divides

a

”, if there exists an integer

k

such that

a

=

kd

. If

d

divides

a

and

d

0

, we say that

d

is a divisor of

a

.

If

d

divides

a

and

d

divides

b

, then

d

is a common divisor of

a

and

b

.

Example 1

Every integer

d

≥ 0

(including

d

= 0

) is a divisor of

0

. While

0

divides no integer except itself,

1

is a divisor of every integer.

The divisors of

12

are

{1, 2, 3, 4, 6, 12}

.

A common divisor of 14 and 77 is 7.

If

d

divides

a

then

d

divides

-

a

.

Slide23

5 October 2017

Veton Këpuska

23

Formal Definitions of LCM & GCD

Definition 2 (prime)

An integer p > 1 is prime if its only divisors are 1 and p.

Definition 3 (Greatest common divisor, relatively prime)

The greatest common divisor, gcd(a, b), of two integers

a

and

b

is the largest of their common divisors, except that gcd(0; 0) = 0 by definition.

Integers a and b are relatively prime if gcd(a, b) = 1.

Example 2

gcd(24, 30) = 6

gcd(4, 7) = 1

gcd(0, 5) = 5

gcd(-6, 10) = 2

Slide24

5 October 2017

Veton Këpuska

24

Formal Definitions of LCM & GCD

Example 3

For all a ≥ 0, a and a + 1 are relatively prime. The integer 1 is relatively prime to all other integers.

Example 4

If p is prime and 1 ≤ a < p, then gcd(a, p) = 1. That is, a and p are relatively prime.

Definition 4

For any positive integer n, we define Euler’s phi function of n, denoted

Φ

(n), as the number of integers d, 1 ≤ d ≤ n, that are relatively prime to n. (Note that

Φ

(1) = 1.)

Slide25

5 October 2017

Veton Këpuska

25

Formal Definitions of LCM & GCD

Example 5

If p is prime, then

Φ

(p) = p - 1. For any integer k > 0,

Φ

(2

k

) = 2

k-1

.

Definition 5

The least common multiple lcm(

a

,

b

) of two integers

a

≥ 0,

b

≥ 0, is the least

m

such that

a divides m

and

b divides m

.

Exercise 1

It can be shown that lcm(

a,b

) =

ab/

gcd

(

a,b

)

.

Slide26

5 October 2017

Veton Këpuska

26

Periodic Discrete-Time Signals

Example: Let

x periodic with fundamental period 5

y periodic with fundamental period 10

If z[n]=x[n]y[n] then z[n] is periodic with fundamental period LCM(5,10)=10

Slide27

5 October 2017

Veton Këpuska

27

Special Periodic Discrete-Time Signals

The sinusoidal sequence angular frequency of the sequence.A is magnitude of the sequence.,  is the phase offset.Note that the discrete-time sinusoidal signal is periodic in the time variable n with period N only if N = 2k/ ∈ Z integer.

Slide28

5 October 2017

Veton Këpuska

28

Special Periodic Discrete-Time Signals

Both formulations are called sinusoidal signals because a cosine can always be expressed as a sin-e function & vice-versa.Using appropriate phase shifts one can always transform a sinusoidal signal in its standard form:Example:

Slide29

5 October 2017

Veton Këpuska

29

Special Periodic Discrete-Time Signals

Fact:Example:

Slide30

5 October 2017

Veton Këpuska

30

Example

Find the condition for which the given discrete time signal is periodic.

Slide31

5 October 2017

Veton Këpuska

31

Complex Exponential Discrete-Time Signals

Although complex valued signals do not occur in nature, they are very useful for the analysis of DT systems as it will be demonstrated later.Definition:x[n] is periodic with fundamental period N/GCD(k,N) (Why? Hint: Euler's identity)

Slide32

5 October 2017

Veton Këpuska

32

Discrete-Time Signals (cont.)

Complex exponential sequence with complex gain A = |A|e

j

Φ

is written as:

x[n] = Ae

j

ω

n

= |A|e

j

Φ

e

j

ω

n

= |A|cos(

ω

n+

Φ

) + j|A|sin(

ω

n+

Φ

)

Important Property:

Complex exponential is periodic in the frequency variable

ω

with period 2

π

:

Ae

j(

ω

+

2

π

)

n

= Ae

j

ω

n

In discrete time we need to consider frequencies only in the range 0≤

ω

2

π

.

Slide33

5 October 2017

Veton Këpuska

33

Periodic and A-periodic Discrete-time Sinusoids

From

Discrete-Time Signal Processing

, 2eby Oppenheim, Schafer, and Buck ©1999-2000 Prentice Hall, Inc.

Slide34

Operations on Discrete-Time Signals

Slide35

5 October 2017

Veton Këpuska

35

Time-Shift

Delay by n0 samplesn→n-n0Advance by n0 samplesn→n+n0Example:

δ

[n]

δ

[n-2]

Slide36

5 October 2017

Veton Këpuska

36

Time Reversal

Time reversal corresponds to reflection of the signal along n=0, the time axis (n →

-n)

Example

x[n]=

δ

[n-2]

y[n]= x[-n]=

δ

[-n-2]=

δ

[-(n+2)]=

δ

[n+2]

Comment:

δ

[n] is an even function of n, that is,

δ

[-n]=

δ

[n].

Slide37

5 October 2017

Veton Këpuska

37

Time Scaling

Time Scaling is achieved by following transformation of time variable n:

n → rn

where r

Q

(set of all rational numbers), r≠0

If |r|<1, the it corresponds to

expansion

of the signal on the n-axis

Otherwise, if |r|>1, it corresponds to

contraction

Note:

Reversal is a special case of time scaling (r=-1)

If for some value of n the product rn is not an integer, we simply skip this value by setting it equal to 0.

Slide38

5 October 2017

Veton Këpuska

38

Examples

x[n] = (-1)nu[n]y[n] = x[2n]u[2n] = (-1)2nu[2n]=[(-1)2]nu[n] = (1)nu[n] = u[n]Comment: Equivalence of u[2n]=u[n] was used in previous derivation. Show that this is correct and why?

x

[n]

y

[n]

Slide39

5 October 2017

Veton Këpuska

39

Examples

Comment:

Contracting using r=2 caused y[n] to contain only every other sample of x[n]. In other words, y[n] is a

sub-sampled

(

decimated

) by 2 version of x[n].

Slide40

5 October 2017

Veton Këpuska

40

Examples

x[n]=u[n] n=0 y[0]=x[0]=1y[n]=x[n/2] n=1 y[1]=x[1/2] – undefined y[1]=0 n=2 y[2]=x[1]=1 …

x

[n]

y

[n]

Slide41

5 October 2017

Veton Këpuska

41

Examples

Comment:

Expanding by a factor of 2 (r=1/2) caused y[n] to contain the samples of x interleased with zeros. This is called

over-sampling

(

interpolation

) by 2 with

zero insertion

.

Slide42

5 October 2017

Veton Këpuska

42

Additional Special Discrete-Signals

After presenting 3 basic operations on signals, the more elaborate ones can be defined next.

Slide43

5 October 2017

Veton Këpuska

43

Additional Special Discrete-Signals

(Rectangular) Pulse Signal

∏(n;n

1

,n

2)

n1

n2

Duration of pulse: n2-n1+1 samples

Slide44

5 October 2017

Veton Këpuska

44

Relationship of Pulse with Step & Unit Impulse Signals

Slide45

5 October 2017

Veton Këpuska

45

Train of Pulses

For N≠0

T

3

(n)

Slide46

5 October 2017

Veton Këpuska

46

Train of Pulses

Comment:

T

N

(n) is periodic with fundamental period N

Note: T

1

(n)=1

∀n

Slide47

5 October 2017

Veton Këpuska

47

Representation of Signals as Superposition of Impulses

Any sequence (e.g., digital signal representation) can be expressed as a weighted sum of unit sample shifted in time; e.g.,:

Slide48

5 October 2017

Veton Këpuska

48

General Representation of a Sequence

Representation Theorem:In general, any sequence can be expressed as a weighted summation (superposition) of shifted unit impulses:

Slide49

5 October 2017

Veton Këpuska

49

Representation of Signals as Superposition of Impulses

Let:

Slide50

5 October 2017

Veton Këpuska

50

Representation of Signals as Superposition of Impulses

In a similar fashion; if x[n]=u[n], then

Slide51

5 October 2017

Veton Këpuska

51

Selected Problems with Solutions

Problem 1

Show that r[n]=nu[n-1]

Solution:

Considering that it has been shown that r[n]=nu[n], the stated problem states something strange. More specifically it needs to be shown that nu[n]=nu[n-1]

n.

To demonstrate this equality the Representation Theorem will be utilized:

Slide52

5 October 2017

Veton Këpuska

52

Solution of the Problem 1

Slide53

5 October 2017

Veton Këpuska

53

Solution of the Problem 1 (cont.)

From (*) it can be observed that:r[n] = nδ[n]+nu[n-1]=nu[n-1], only if nδ[n]=0.Since δ[n]=1 for n=0 & δ[n]=0 for n≠0 ⇒ indeed nδ[n]=0.Therefore,r[n] = nu[n]=nu[n-1]Comment:The fact that nδ[n]=0 ∀n, is a special case of the sifting property of the impulse/δ function:x[n]δ[n-n0]=x[n0]δ[n-n0] ∀n,n0

Slide54

5 October 2017

Veton Këpuska

54

Problem 2

Show that: ∏(n-n0;n1,n2)=∏(n;n1+n0,n2+n0) Solution

Slide55

5 October 2017

Veton Këpuska

55

Problem 3

Simplify r[2n] by writing it as an expression of elementary functions.

Solution:

r[2n]=(2n)u[2n]=(2n)u[n]=2nu[n]=2r[n]

Slide56

5 October 2017

Veton Këpuska

56

Problem 4

Express x[n], given below in terms of elementary signal:Solution:

Slide57

5 October 2017

Veton Këpuska

57

Problem 5

Simplify y[n]=x[n]TN(n)Hint: Use sifting property.Solution

Slide58

Introduction to Discrete Time Systems

Slide59

5 October 2017

Veton Këpuska

59

Overview

Introduction to Discrete Time Systems

Taxonomy of Systems based on System properties

Slide60

5 October 2017

Veton Këpuska

60

Introduction to Discrete Time Systems

DSP

1

’s

subject matter involves the mathematical modeling & analysis of real-world

DSP

2

devices.

Definition:

A Discrete-Time system is an operator on the domain of complex-valued (in general) sequences, which take values in the same domain (range or co-domain)

Slide61

5 October 2017

Veton Këpuska

61

Discrete-Time Signals

A Discrete-Time Signal is a function of the sample index to set C:This function thus maps n ∈ Z to the value of the signal x[n].

Slide62

5 October 2017

Veton Këpuska

62

Discrete-Time Systems

A Discrete-Time System is a function of functions (operator) that takes an input signal and maps it to an output signal.It is a mapping within the set of all complex valued signals S.

Slide63

5 October 2017

Veton Këpuska

63

Examples

Discrete-Time Signal x:

x[n]=2n

2

+1 n=0,

±

1,

±

2,…

Discrete-Time System T:

y[n]=T{x[n]}=x

3

[n]+x[n-1]+3n

Slide64

5 October 2017

Veton Këpuska

64

Discrete-Time System

A discrete–time system can be thought of as a transformation T(x) of an input sequence to an output sequence:y[n] = T{x[n]}Graphical Representation

T

x[n]

y[n]

Input

signal

Discrete-Time

System

Output

signal

Slide65

5 October 2017

Veton Këpuska

65

A First Taxonomy on Systems

The presented definition of Discrete-Time System (operator) refers to a Single Input Single Output (SISO) system.

However, systems can have multiple inputs and/or outputs:

T

x[n]

y

1[n]

y

2

[n]

H

x

2

[n]

y

1[n]

y

2

[n]

T is a SIMO (Single Input Multiple Output) System

H is a MIMO (Multiple Input Multiple Output) System

x

1

[n]

Slide66

5 October 2017

Veton Këpuska

66

A First Taxonomy on Systems (cont.)

In general a MIMO system is represented with:

Slide67

5 October 2017

Veton Këpuska

67

Taxonomy of Systems (Based on System Properties

Discrete-Time Systems can be categorized into many subgroups depending on whether they possess a given property or not.

In the

sequel -

these properties are examined and examples are presented

Slide68

5 October 2017

Veton Këpuska

68

Homogeneity or Scaling Property

Definition:A Discrete-Time System T has the homogeneity (scaling) property if and only if:

T{

x[n]} =

T{x[n]} =

y[n]

∀n

x ∈

S

&

C

Slide69

5 October 2017

Veton Këpuska

69

Examples

Show that the system defined by T{x[n]}=2x[n] is homogeneous.Proof

Slide70

5 October 2017

Veton Këpuska

70

Examples

Show that the system defined by T{x[n]}=x2[n] is NOT homogeneous.Proof

Slide71

5 October 2017

Veton Këpuska

71

T{}

T{}

Homogeneity or Scaling Property

The homogeneity property indicates that if a system T is homogeneous the following two block diagrams are equivalent:

x[n]

y[n]=

T{

x[n]}

x[n]

y[n]=

T{x[n]}

x[n]

T{

x[n]}

In other words, the order in multiplication of the multiplier

and

the system

T

can be interchanged

Slide72

5 October 2017

Veton Këpuska

72

Superposition (Additive) Property

Definition:A Discrete-Time System T has Superposition (Additive) property if and only if:

T{x

1

[n] + x

2

[n]} = T{x

1

[n]} + T{x

2

[n]}

x

1

, x

2

S

Slide73

5 October 2017

Veton Këpuska

73

T{}

T{}

T{}

Superposition (Additive) Property.

If T has the Superposition (Additive) property, then the following block diagrams are equivalent.

x

1

x

2

y=

T{x

1

[n] + x

2

[n]}

x

1

[n] + x2[n]

x

1

x

2

T{x

2

[n]}

y=

T{x

1

[n]}+T{x

2[n]}

T{x1[n]}

Slide74

5 October 2017

Veton Këpuska

74

Examples

Show that T{x[n]}=-3x[n] has/possesses the superposition property.Proof:

Slide75

5 October 2017

Veton Këpuska

75

Examples

Show that T{x[n]}=x2[n] does NOT have/possess the superposition property.Proof:

Slide76

5 October 2017

Veton Këpuska

76

Linearity Property

Definition:

A Discrete-Time System T is

linear

(e.g., has linearity property) if and only if T

has/possesses:

Homogeneous

property

Superposition

property

Slide77

5 October 2017

Veton Këpuska

77

T{}

T{}

T{}

ax

1

[n] + bx

2[n]

Property of Linear Systems

T{ax1[n] + bx2[n]} = aT{x1[n]} + bT{x2[n]}

x

1

x

2

a

b

y=

T{ax

1

[n] + bx

2

[n]}

x

1

x

2

a

b

bT{x

2

[n]}

y= a

T{x

1

[n]}+

b

T{x

2

[n]}

aT{x

1

[n]}

Slide78

5 October 2017

Veton Këpuska

78

Comment

A Discrete-Time system T that is

not linear

is called

non-liner

system.

Linear Discrete-Time systems are of paramount importance in engineering because they are mathematically tractable and amenable to thorough and exact analysis. They have been studied for at least 3 centuries and there exists a rich volume of studies and results on them.

The mainstream DSP discipline is almost entirely dedicated to linear systems, their analysis and their design.

On the other hand, non-linear systems are often extremely hard to analyze and understand. Thus research on them has started relatively recently (last century) and encountered spectacular observations & results (e.g., Mathematical Chaos Theory, etc.)

However, non-linear systems are beyond the scope of this class.

Slide79

5 October 2017

Veton Këpuska

79

Time Invariance Property

Definition:

A Discrete-Time system is called (i.e., has the property of) time invariant if and only if the following holds:

If y[n] = T(x[n])

then y[n-n

0

] = T(x[n-n

0

])

for

∀ n,

n

0

Z

Slide80

5 October 2017

Veton Këpuska

80

Time Invariance Property

Explanation;

Let the output of the system T be y[n] for the input x[n].

Now, let’s say that the same system has an input a delayed (or advanced) version of x[n] by n

0

samples.

If the output of the system is the same as in the first case, only shifted by the same amount n

0

(i.e., y[n-n

0

]) then T is Time Invariant system.

Slide81

5 October 2017

Veton Këpuska

81

Ideal Time Delay Operator (System)

It is useful at this point to introduce a very simple system, called the ideal time delay D.Ideal time delay system D is defined as:y[n]=D{x[n]}=x[n-1]Which delays its input signal by 1 sample.

x[n]

D

x[n-1]

n

n-1

Slide82

5 October 2017

Veton Këpuska

82

Ideal Time Delay Operator (System)

In general, one can define the ideal time delay by n0 samples (if n0>0 it is delay, otherwise if it is n0<0 it is advance) denoted as Dn0 and defined as:When n0=0, D0{x[n]}=x[n], which is called the identity system.

Slide83

5 October 2017

Veton Këpuska

83

Ideal Time Delay Operator

Base on the presented definitions, the following block diagrams are equivalent:In other words, D2{} is a shorthand notation for D{D{}}.

x[n]

D

x[n-2]

D

x[n]

D

2

x[n-2]

Slide84

5 October 2017

Veton Këpuska

84

Ideal Time Delay Operator

Using the ideal delay we can re-express the definition of Time Invariance as follows.Definition:A Discrete-Time system is Time-Invariant if and only if:The Dn0 and T operators commute.

Slide85

5 October 2017

Veton Këpuska

85

Ideal Time Delay Operator

If T is Time Invariant, then the following block diagrams are equivalent:The order of T and Dn0 in cascade connection is invariant.

x[n]

D

n

0

T{x[n-n0]}= T{Dn0{x[n]}}

T

x[n-n

0

]

x[n]

T

D

n

0{T{x[n]}}= T{x[n-n0]}

Dn0

T{x[n]}

Slide86

5 October 2017

Veton Këpuska

86

Time Variant Systems

Systems that are not Time-Invariant are called Time Variant systems.

Slide87

5 October 2017

Veton Këpuska

87

Examples

T{x[n]}=x4[n]+3.Show that T is Time Invariant.Proof:The operator D commutes with itself, thus D, that is, the ideal time delay system is Time Invariant

Slide88

5 October 2017

Veton Këpuska

88

Examples

Show that the following system, T{x[n]}=nx[n], is not Time Invariant, that is, it is Time Variant.Proof

Slide89

Linear Time Invariant Systems

Slide90

5 October 2017

Veton Këpuska

90

Linear Time Invariant Systems

Definition:

A Discrete Time system T is

Linear, and

Time invariant,

Then the system is referred to as

linear time-invariant

(LTI) system.

Comment:

LTI systems are the easiest, more manageable to analyze and design mathematically.

Slide91

5 October 2017

Veton Këpuska

91

Unit Sample Response and LTI

Any sequence (digital signal) can be expressed as a weighted sum of unit sample shifted in time; e.g.,:In General:On the other hand:

Slide92

5 October 2017

Veton Këpuska

92

Convolution

By applying Superposition Principle and Linear Time Invariance we can derive expression that defines convolution:

Slide93

Convolution

5 October 2017

Veton Këpuska

93

Slide94

5 October 2017

Veton Këpuska

94

Dynamic Systems

Definition

A Discrete-Time system is called

dynamic

if and only if its output y[n] depends not only on the present value of its input (i.e., x[n]), but also on x’s future and/or past values.

A Discrete-Time system that is not dynamic is called

memory-less

or

static

. In this case y[n] depends only on the current value of x: x[n].

Slide95

5 October 2017

Veton Këpuska

95

Examples

y[n]=T{x[n]}=(n

2

-1)x

3

[n]

T is static/memoryless because y[n]=T{x[n]} depends only on the present value of x (i.e., x[n])

y[n]=T{x[n]}=x[n+3]+5

T is dynamic because y[n]=T{x[n]} depends on the future value of x (i.e., x[n+3], 3 samples ahead)

Slide96

Discrete-Time Systems

Properties of LTI

Slide97

5 October 2017

Veton Këpuska

97

Causality:

Definition

A Discrete-Time system is called a

causal

system if and only if its output y[n] does not depend on the future values of its input. Otherwise, the system is called

non-causal

.

A more formal definition of a causal system is one where for any time instant n

0

, y[n

0

] – output of the system, does not depend on its input x[n] for n>n

0:

Slide98

5 October 2017

Veton Këpuska

98

Examples

y[n]=T{x[n]}=D{x[n]}=x[n-1]

Proof: y[n] depends only on the past values of x, that is x[n-1].

Thus, T{D} is

causal

.

y[n]=T{x[n]}=D

-2

{x[n]}=x[n+2]

y[n] depends on the future values of x (x[n+2]) the system thus is non-causal.

T{D

-2

} is

non-causal

.

Slide99

5 October 2017

Veton Këpuska

99

Comments

All static/memoryless systems are causal (Why?)

Systems, whose output depend only on present and future values of their inputs, are called

anti-causal

. Thus, anti-causal systems are a subset of non-causal systems.

Slide100

5 October 2017

Veton Këpuska

100

Stability – BIBO Stable Systems

Definition:

A Discrete Time signal x is called bounded if and only if for some positive constant Mx depending on x the following holds:

|x[n]|≤Mx

∀n

-

Mx≤x[n]≤Mx

∀n

That is, x is bounded within the strip [-

Mx, Mx]

Slide101

5 October 2017

Veton Këpuska

101

Graphical Example of a Bounded Signal

Mx

-Mx

Slide102

5 October 2017

Veton Këpuska

102

BIBO Stable Systems

Definition:

A Discrete Time system T is called BIBO stable if and only if any bounded input of the system produces a bounded output.

For:

If for |x[n]|≤M

x

∀n

|T{x[n]}|

≤M

y

∀n,

the system then is called BIBO stable.

Note M

x

is not necessarily equal to M

y

.

A system that is not BIBO stable is called unstable.

Slide103

5 October 2017

Veton Këpuska

103

Examples

y[n]=T{x[n]}=x

2

[n], T is BIBO Stable.

Proof.

|T{x[n]}|=|x

2

[n]|=|x[n]|

2

……(1)

Let’s assume that

|x[n]|≤M

x

∀n,

|x[n]|

2

≤M

x

2

……(2)

Combining (1) & (2)

|T{x[n]}|=|x[n]|

2

≤M

x

2

or

|T{x[n]}|≤M

y

where M

y

=M

x

2

Slide104

5 October 2017

Veton Këpuska

104

Examples

y[n]=T{x[n]}=log(x[n]), T is unstable.

Proof

Assume that

|x[n]|≤M

x

∀n,

……(1)

Then

|T{x[n]}|=|log(x[n])|

……(2)

From (1)

|x[n]|≤M

x

∀n ⇒ -

M

x

≤x[n]≤M

x

∀n

However, log(x[n]) will be undefined for values of x[n]<0 and it will take unbounded negative value (-∞) when x[n]→0.

This in turn ⇒ from (2) that can not be bound and thus T is unstable.

Slide105

Discrete-Time Systems

Properties of LTI

Slide106

5 October 2017

Veton Këpuska

106

Properties of LTI:

Stability:Every bounded input produces a bounded output:If |x[n]| < ∞, then |y[n]| < ∞ for all n.Necessary and sufficient condition for stability is that h[n] be absolutely summable:

Slide107

5 October 2017

Veton Këpuska

107

Properties of LTI:

Causality:

A causal system is one where for any time instant n

0

, y[n

0

] does not depend on x[n] for n>n

0:

Output does not depend on the future values of the input.

A necessary and sufficient condition for causality is that:

h[n] = 0, for n<0.

A consequence of causality is that for the system

y[n] = T(x[n]):

if x

1

[n] = x

2

[n] for n<n

0

,

then y

1

[n] = y

2

[n] for n<n

0

,

Slide108

5 October 2017

Veton Këpuska

108

Example 2.1

Assume that an LTI system has an exponentially decaying impulse response:h[n] = Aan for n≥0 Causality:h[n] = 0 for n≤0Stability:|a| < 1 the system is stable because the impulse response is absolutely summable:

Slide109

5 October 2017

Veton Këpuska

109

Properties of LTI Systems (cont).

h

1

[n]

h2[n]

x[n]

y[n]

h

2

[n]

h

1[n]

x[n]

y[n]

h

1

[n]*h

2[n]

x[n]

y[n]

h

2

[n]*h1[n]

x[n]

y[n]

h1[n]

h

2

[n]

x[n]

y[n]

h

1

[n]+h

2

[n]

x[n]

y[n]

h

2

[n]+h

1

[n]

x[n]

y[n]

Slide110

Linear Constant-Coefficient Difference Equations

Slide111

5 October 2017

Veton Këpuska

111

Linear Constant-Coefficient Difference Equations

All discrete time, linear, causal, time invariant

systems

can be described by the

N

th

order difference equations that have constant-coefficients

.

Slide112

5 October 2017

Veton Këpuska

112

Liner Constant-Coefficient Difference Equations

Nth-order linear constant-coefficient difference equation is of the form:Where x[n] is the input, and y[n] is the output.Normalizing the equation by the value of a0 the following is obtained:

Slide113

5 October 2017

Veton Këpuska

113

Accumulator Example

Accumulator function is defined as:

Slide114

5 October 2017

Veton Këpuska

114

Liner Constant-Coefficient Difference Equations (cont.)

D

x[n]

y[n]

y[n-1]

Slide115

5 October 2017

Veton Këpuska

115

General Formulation of Difference Equation

Equation:Along with initial conditions:y[-1], y[-2], …, y[-N]Uniquely specifies the LTI system.General equation must be computed using recursive procedure.

Slide116

5 October 2017

Veton Këpuska

116

Flow Graph Representation of Liner Constant-Coefficient Difference Equation

D

D

D

x[n]

y[n]

β

1

x[n-1]

β

2

x[n-2]

β

M

x[n-M]

D

D

D

α

1

y[n-1]

α

2

y[n-2]

α

N

y[n-N]

β

0

Slide117

5 October 2017

Veton Këpuska

117

Example

Recursive Computation of Difference Equations:

y[n] = ay[n-1]+x[n]

Initial condition is given by y[-1] = c;

Input x[n] = K

[n]

Solution n≥0:

y[0] = ac+K

y[1] = ay[0]+0 = a(ac+K) = a

2

c+aK

y[n] = a

n+1

c+a

n

K,

n≥0

Slide118

5 October 2017

Veton Këpuska

118

Example (cont.)

Solution n<0:

y[n] = ay[n-1]+x[n]

y[n-1] = a

-1

(y[n]-x[n])

y[-1] = c

y[-2] =

a

-1

(y[-1]-x[-1])

=

a

-1

(c+0) = a

-1

c

y[n] = a

n+1

c, n<0

Overall solution

y[n] = a

n+1

c+Ka

n

u[n],

n

Slide119

Digital Filters

FIR, IIR Filters.

Slide120

5 October 2017

Veton Këpuska

120

General Formulation of a Digital Filter through Difference Equation

Equation:Along with initial conditions:y[-1], y[-2], …, y[-N]Uniquely specifies a Digital Filter system.

Slide121

5 October 2017

Veton Këpuska

121

Digital Filters

There are two (2) broad classes of filters that can be defined based on the properties of general constant-coefficient difference equation.

Finite Impulse Response (FIR) Filters, &

Infinite Impulse Response (IIR) Filters

Slide122

5 October 2017

Veton Këpuska

122

FIR Filter

A system that has ak coefficients equal to zero for k=1,…,N is said to be a Finite Impulse Response (FIR) filter. The name reflects the fact that FIR filters have finite impulse (e.g., unit sample) response.FIR filters are also called moving average (MA) filters considering the fact their output is simply a weighted average of the input values.

Slide123

5 October 2017

Veton Këpuska

123

IIR Filters

The second class of digital filters are infinite impulse response (IIR) filters. This class includes bothAutoregressive (AR) filters and The most general form autoregressive and moving average (ARMA) filters.AR filter:ARMA filter:

Slide124

FIR Filters

Slide125

5 October 2017

Veton Këpuska

125

FIR Filters

General constant-coefficients equation:Impulse (unit sample) response, h[n], of the filter is obtained when x[n]=δ[n].

Slide126

5 October 2017

Veton Këpuska

126

Linear Phase of FIR Filters

If FIR filter has coefficients that are symmetric, as depicted in the following relationship:Then it can be shown that the resulting filter has linear phase ⇒ constant delay for all frequency components of the input signal.This property is very important in many communications data streams (speech, data, …) and image processing applications.

Slide127

5 October 2017

Veton Këpuska

127

FIR Filter Structures

For a given difference equation there are different ways to implement a digital filter.

Selection of a particular filter structure to be implemented is dependent on many factors:

Programming considerations

Hardware

Sensitivity of Quantizing Coefficients

Quantization noise of the input signal.

Slide128

5 October 2017

Veton Këpuska

128

Direct Structure of an FIR filter

D

x[n]

y[n]

β

0

x[n-1]

D

β

1

x[n-2]

D

β

2

x[n-M]

β

M

Slide129

5 October 2017

Veton Këpuska

129

Symmetric – Linear Phase

FIR

filter

Better Implementation:

D

D

D

x[n]

y[n]

x[n-1]

x[n-2]

x[n-M/2+1]

D

D

β

L/2

x[n-M/2]

β

1

β

0

Slide130

5 October 2017

Veton Këpuska

130

MATLAB fdatool

MATLAB’s filter design & analysis tool (

fdatool) can be used to obtain filter coefficients that fulfill required criteria.

Important Design Parameters of a Filter

Pass Band (F

pass)

Stop Band (F

stop

)

Transition Band

Sample Rate (F

s

)

Pass Band Attenuation (A

pass

)

Stop Band Attenuation (A

stop

)

Slide131

5 October 2017

Veton Këpuska

131

Digital Filter Specifications

Additional Filter Specifications & Definitions

Pass-band

δ

s

1

-

δ

p

1

+

δp

H(ω)

0

0

1

A

p

Transition

band

ω

p

ω

s

ω

π

A

s

Stop-band

Pass-band Ripple

Stop-band Ripple

Slide132

Example: Chebyshev FIR Filter

5 October 2017

Veton Këpuska

132

Slide133

5 October 2017

Veton Këpuska

133

Slide134

Time & Frequency Domain Representation

5 October 2017

Veton Këpuska

134

Slide135

FIR Filter Impulse Response

5 October 2017

Veton Këpuska

135

Slide136

Exporting Filter Coefficients

5 October 2017

Veton Këpuska

136

Slide137

Double Precision Filter Coeffs

/* * Filter Coefficients (C Source) generated by the Filter Design and Analysis Tool * Generated by MATLAB(R) 9.2 and the Signal Processing Toolbox 7.4. * Generated on: 05-Oct-2017 15:46:43 *//* * Discrete-Time FIR Filter (real) * ------------------------------- * Filter Structure : Direct-Form FIR * Filter Length : 101 * Stable : Yes * Linear Phase : Yes (Type 1) *//* General type conversion for MATLAB generated C-code */#include "tmwtypes.h"/* * Expected path to tmwtypes.h * C:\Program Files\MATLAB\R2017a\extern\include\tmwtypes.h */

5 October 2017

Veton Këpuska

137

Slide138

const

int BL = 101;const real64_T B[101] = { 1.242575504571e-06,3.613463478719e-06,-1.604575535582e-20,-1.034852825548e-05, -8.338323755514e-06,1.767130176435e-05,3.145726376084e-05,-1.332227624413e-05, -7.138512439134e-05,-2.514866477747e-05,0.0001126743531421, 0.000121396153423, -0.0001117911351032,-0.0002779234695703,1.974092467395e-18, 0.000445899290354, 0.00028823982035,-0.0005047276658825,-0.0007593635942055, 0.000276729826275, 0.001294811347326, 0.000403227591654,-0.001613663417362,-0.001566912869014, 0.001310738257002, 0.002980829904163,-4.428547345523e-18,-0.004075742951651, -0.002452149770156, 0.004016293839772, 0.005678544009039,-0.001953581295799, -0.008667601799902,-0.002570874520001, 0.009843077639442, 0.009186843671145, -0.007422835970842, -0.01639157026913,1.189267801698e-17, 0.02152219247079, 0.01282865763273, -0.02100739775759, -0.03002973947377, 0.01059425246544, 0.04911083470707, 0.0156177852628, -0.06659591672908, -0.07359568413636, 0.07889962678076, 0.3068065282419, 0.4166657037476, 0.3068065282419, 0.07889962678076, -0.07359568413636, -0.06659591672908, 0.0156177852628, 0.04911083470707, 0.01059425246544, -0.03002973947377, -0.02100739775759, 0.01282865763273, 0.02152219247079,1.189267801698e-17, -0.01639157026913, -0.007422835970842, 0.009186843671145, 0.009843077639442,-0.002570874520001, -0.008667601799902,-0.001953581295799, 0.005678544009039, 0.004016293839772, -0.002452149770156,-0.004075742951651,-4.428547345523e-18, 0.002980829904163, 0.001310738257002,-0.001566912869014,-0.001613663417362, 0.000403227591654, 0.001294811347326, 0.000276729826275,-0.0007593635942055,-0.0005047276658825, 0.00028823982035, 0.000445899290354,1.974092467395e-18,-0.0002779234695703, -0.0001117911351032, 0.000121396153423,0.0001126743531421,-2.514866477747e-05, -7.138512439134e-05,-1.332227624413e-05,3.145726376084e-05,1.767130176435e-05, -8.338323755514e-06,-1.034852825548e-05,-1.604575535582e-20,3.613463478719e-06, 1.242575504571e-06};

5 October 2017

Veton Këpuska

138

Slide139

Single Precision Filter Coeffs

/* * Filter Coefficients (C Source) generated by the Filter Design and Analysis Tool * Generated by MATLAB(R) 9.2 and the Signal Processing Toolbox 7.4. * Generated on: 05-Oct-2017 16:06:29 *//* * Discrete-Time FIR Filter (real) * ------------------------------- * Filter Structure : Direct-Form FIR * Filter Length : 101 * Stable : Yes * Linear Phase : Yes (Type 1) *//* General type conversion for MATLAB generated C-code */#include "tmwtypes.h"/* * Expected path to tmwtypes.h * C:\Program Files\MATLAB\R2017a\extern\include\tmwtypes.h *//* * Warning - Filter coefficients were truncated to fit specified data type. * The resulting response may not match generated theoretical response. * Use the Filter Design & Analysis Tool to design accurate * int32 filter coefficients. */

5 October 2017

Veton Këpuska

139

Slide140

const

int BL = 101;const int32_T B[101] = { 2668, 7760, 0, -22223, -17906, 37949, 67554, -28609, -153298, -54006, 241966, 260696, -240070, -596836, 0, 957561, 618990, -1083894, -1630721, 594273, 2780586, 865925, -3465316, -3364920, 2814789, 6401283, 0, -8752591, -5265952, 8624925, 12194580, -4195284, -18613533, -5520911, 21137848, 19728597, -15940419, -35200629, 0, 46218556, 27549332, -45113043, -64488374, 22750984, 105464714, 33538938, -143013642, -158045528, 169435658, 658862002, 894782785, 658862002, 169435658, -158045528, -143013642, 33538938, 105464714, 22750984, -64488374, -45113043, 27549332, 46218556, 0, -35200629, -15940419, 19728597, 21137848, -5520911, -18613533, -4195284, 12194580, 8624925, -5265952, -8752591, 0, 6401283, 2814789, -3364920, -3465316, 865925, 2780586, 594273, -1630721, -1083894, 618990, 957561, 0, -596836, -240070, 260696, 241966, -54006, -153298, -28609, 67554, 37949, -17906, -22223, 0, 7760, 2668};

5 October 2017

Veton Këpuska

140

Slide141

Signed 16-bit integer

/* * Filter Coefficients (C Source) generated by the Filter Design and Analysis Tool * Generated by MATLAB(R) 9.2 and the Signal Processing Toolbox 7.4. * Generated on: 05-Oct-2017 16:13:19 *//* * Discrete-Time FIR Filter (real) * ------------------------------- * Filter Structure : Direct-Form FIR * Filter Length : 101 * Stable : Yes * Linear Phase : Yes (Type 1) *//* General type conversion for MATLAB generated C-code */#include "tmwtypes.h"/* * Expected path to tmwtypes.h * C:\Program Files\MATLAB\R2017a\extern\include\tmwtypes.h *//* * Warning - Filter coefficients were truncated to fit specified data type. * The resulting response may not match generated theoretical response. * Use the Filter Design & Analysis Tool to design accurate * int16 filter coefficients. */

5 October 2017

Veton Këpuska

141

Slide142

const

int BL = 101;const int16_T B[101] = { 0, 0, 0, 0, 0, 1, 1, 0, -2, -1, 4, 4, -4, -9, 0, 15, 9, -17, -25, 9, 42, 13, -53, -51, 43, 98, 0, -134, -80, 132, 186, -64, -284, -84, 323, 301, -243, -537, 0, 705, 420, -688, -984, 347, 1609, 512, -2182, -2412, 2585, 10053, 13653, 10053, 2585, -2412, -2182, 512, 1609, 347, -984, -688, 420, 705, 0, -537, -243, 301, 323, -84, -284, -64, 186, 132, -80, -134, 0, 98, 43, -51, -53, 13, 42, 9, -25, -17, 9, 15, 0, -9, -4, 4, 4, -1, -2, 0, 1, 1, 0, 0, 0, 0, 0};

5 October 2017

Veton Këpuska

142

Slide143

IIR Filters

Slide144

5 October 2017

Veton Këpuska

144

IIR Filters

IIR Filters in general (ARMA) are of the form:Properties:No simple relationship between the coefficient of the IIR filter and the impulse response as compared to FIR.Because symmetry is required for linear phase, most IIR filters will not have linear phase since they are right-sided and infinite in duration.A class of linear phase IIR filters has been shown to exist (M.A. Clements and J.W. Pease, “On Causal Linear Phase IIR Digital Filters,”, IEEE Transaction Acoustics, Speech and Signal Processing, vol. 37, no 4, pp.479-485, April 1989.In general IIR filters require less coefficients to approximate a given filter frequency response than FIR filters.

Slide145

5 October 2017

Veton Këpuska

145

Flow Graph Representation of ARMA Difference Equation

D

D

D

x[n]

y[n]

β

1

x[n-1]

β

2

x[n-2]

β

M

x[n-M]

D

D

D

α

1

y[n-1]

α

2

y[n-2]

α

N

y[n-N]

β

0

Slide146

5 October 2017

Veton Këpuska

146

Direct Form Realization of an IIR filter

Slide147

Direct Form Realization of an IIR filter (cont.)

5 October 2017

Veton Këpuska

147

Slide148

Direct Form Realization of an IIR filter (cont.)

5 October 2017

Veton Këpuska

148

Slide149

Direct Form Realization of an IIR filter (cont.)

5 October 2017

Veton Këpuska

149

Slide150

Direct Form Realization of an IIR filter (cont.)

5 October 2017

Veton Këpuska

150

Slide151

5 October 2017

Veton Këpuska

151

Direct Form Realization of an IIR

D

D

D

x[n]

y[n]

β

1

d

[n-1

]

β

2

d

[n-2

]

β

M

d

[n-M]

α1d[n-1]

α2d[n-2]

αMd[n-M]

β0

D

α

N

d[n-N]

Slide152

Example: IIR Filter Design -Chebyshev Type II, Order 20

5 October 2017

Veton Këpuska

152

Slide153

Magnitude and Phaze Response

5 October 2017

Veton Këpuska

153

Slide154

5 October 2017

Veton Këpuska

154

Impulse Response of IIR Filter

Slide155

5 October 2017

Veton Këpuska

155

Export of Filter Coefficients

Slide156

5 October 2017

Veton Këpuska

156

Floating Point (Double Precision) IIR Filter Coefficients: float64

#define MWSPT_NSEC 21const int NL[MWSPT_NSEC] = { 1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1 };const real64_T NUM[MWSPT_NSEC][3] = { { 0.7602090521033, 0, 0 }, { 1, -0.5118722830641, 1 }, { 0.7012817822195, 0, 0 }, { 1, -0.4649859321869, 1 }, { 0.6426098615717, 0, 0 }, { 1, -0.3671283220828, 1 }, { 0.5829322220034, 0, 0 },

/*

* Filter Coefficients (C Source) generated by the Filter Design and Analysis Tool

* Generated by MATLAB(R) 9.2 and the Signal Processing Toolbox 7.4.

* Generated on: 05-Oct-2017 16:33:57

*/

/*

* Discrete-Time IIR Filter (real)

* -------------------------------

* Filter Structure : Direct-Form II, Second-Order Sections

* Number of Sections : 10

* Stable : Yes

* Linear Phase : No

*/

/* General type conversion for MATLAB generated C-code */

#include "

tmwtypes.h

"

/*

* Expected path to

tmwtypes.h

* C:\Program Files\MATLAB\R2017a\extern\include\

tmwtypes.h

*/

Slide157

{ 1, -0.2100714675086, 1 }, { 0.5221912610589, 0, 0 }, { 1, 0.01812065472288, 1 }, { 0.4616829828366, 0, 0 }, { 1, 0.33052112153, 1 }, { 0.4042262779079, 0, 0 }, { 1, 0.7328559321778, 1 }, { 0.3541012215421, 0, 0 },

{ 1, 1.203268897037, 1 }, { 0.3164715207174, 0, 0 }, { 1, 1.661136007666, 1 }, { 0.2961714354762, 0, 0 }, { 1, 1.958612552033, 1 }, { 1, 0, 0 }};

5 October 2017

Veton Këpuska

157

Slide158

const

int DL[MWSPT_NSEC] = { 1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1 };const real64_T DEN[MWSPT_NSEC][3] = { { 1, 0, 0 }, { 1, -0.7936506725907, 0.9249388336912 }, { 1, 0, 0 }, { 1, -0.7110079175494, 0.7874853187574 }, { 1, 0, 0 }, { 1, -0.6111238673374, 0.6604233102482 }, { 1, 0, 0 },

{ 1, -0.4955540282244, 0.5389610448969 }, { 1, 0, 0 }, { 1, -0.3673665077585, 0.4212114774173 }, { 1, 0, 0 }, { 1, -0.2321414618874, 0.3081034048391 }, { 1, 0, 0 }, { 1, -0.09877103779267, 0.2034632193155 }, { 1, 0, 0 },

5 October 2017

Veton Këpuska

158

Slide159

{ 1, 0.02048793793224, 0.1137934914362 }, { 1, 0, 0 }, { 1, 0.1113992783921, 0.04724600150727 }, { 1, 0, 0 }, { 1, 0.1608537839918, 0.01157417803795 }, { 1, 0, 0 }};

5 October 2017

Veton Këpuska

159

Slide160

5 October 2017

Veton Këpuska

160

Fixed Point Coefficients of IIR Low-pass Filter: Q.31

/* General type conversion for MATLAB generated C-code */#include "tmwtypes.h"/* * Expected path to tmwtypes.h * C:\MATLAB6p5p1\extern\include\tmwtypes.h */#define MWSPT_NSEC 11const int NL[MWSPT_NSEC] = { 1,3,3,3,3,3,3,3,3,3,3 };const int32_T NUM[MWSPT_NSEC][3] = { { 8156376, 0, 0}, { 2147483647, 2147483647, 2147483647}, { 2147483647, 2147483647, 2147483647}, { 2147483647, 2147483647, 2147483647}, { 2147483647, 1955625778, 2147483647}, { 2147483647, 1147841473, 2147483647}, { 2147483647, 496727511, 2147483647}, { 2147483647, 7250145, 2147483647}, { 2147483647, -336703210, 2147483647}, { 2147483647, -553999449, 2147483647}, { 2147483647, -658938807, 2147483647}};

/*

* Discrete-Time IIR Filter (real)

* -------------------------------

* Filter Structure : Direct-Form II, Second-Order Sections

* Filter Order :

2

0

* Stable : Yes

* Linear Phase : No

*/

const

int DL[MWSPT_NSEC] = { 1,3,3,3,3,3,3,3,3,3,3 };

const int32_T DEN[MWSPT_NSEC][3] = {

{ 2147483647, 0, 0},

{ 2147483647, 1045146066, 140984708},

{ 2147483647, 921586457, 217821385},

{ 2147483647, 696437214, 360212748},

{ 2147483647, 405260096, 550146428},

{ 2147483647, 85955653, 769037951},

{ 2147483647, -229535171, 1002388064},

{ 2147483647, -518418894, 1241822623},

{ 2147483647, -766268901, 1485201141},

{ 2147483647, -964356214, 1736041397},

{ 2147483647, -1106538428, 2003277384}

};

Slide161

5 October 2017

Veton Këpuska

161

Fixed Point Coefficients of IIR Low-pass Filter: Q.15

/* General type conversion for MATLAB generated C-code */#include "tmwtypes.h"/* * Expected path to tmwtypes.h * C:\MATLAB6p5p1\extern\include\tmwtypes.h */#define MWSPT_NSEC 11const int NL[MWSPT_NSEC] = { 1,3,3,3,3,3,3,3,3,3,3 };const int16_T NUM[MWSPT_NSEC][3] = { { 124, 0, 0 }, { 32767, 32767, 32767 }, { 32767, 32767, 32767 }, { 32767, 32767, 32767 }, { 32767, 29840, 32767 }, { 32767, 17515, 32767 }, { 32767, 7579, 32767 }, { 32767, 111, 32767 }, { 32767, -5138, 32767 }, { 32767, -8453, 32767 }, { 32767, -10055, 32767 }};

/*

* Discrete-Time IIR Filter (real)

* -------------------------------

* Filter Structure : Direct-Form II, Second-Order Sections

* Filter Order :

2

0

* Stable : Yes

* Linear Phase : No

*/

const

int DL[MWSPT_NSEC] = { 1,3,3,3,3,3,3,3,3,3,3 };

const int16_T DEN[MWSPT_NSEC][3] = {

{ 32767, 0, 0 },

{ 32767, 15948, 2151 },

{ 32767, 14062, 3324 },

{ 32767, 10627, 5496 },

{ 32767, 6184, 8395 },

{ 32767, 1312, 11735 },

{ 32767, -3502, 15295 },

{ 32767, -7910, 18949 },

{ 32767, -11692, 22662 },

{ 32767, -14715, 26490 },

{ 32767, -16884, 30568 }

};

Slide162

5 October 2017

Veton Këpuska

162

Fixed Point Coefficients of IIR Low-pass Filter: Q.7

/* General type conversion for MATLAB generated C-code */#include "tmwtypes.h"/* * Expected path to tmwtypes.h * C:\MATLAB6p5p1\extern\include\tmwtypes.h */#define MWSPT_NSEC 11const int NL[MWSPT_NSEC] = { 1,3,3,3,3,3,3,3,3,3,3 };const int8_T NUM[MWSPT_NSEC][3] = { { 0, 0, 0 }, { 127, 127, 127 }, { 127, 127, 127 }, { 127, 127, 127 }, { 127, 117, 127 }, { 127, 68, 127 }, { 127, 30, 127 }, { 127, 0, 127 }, { 127, -20, 127 }, { 127, -33, 127 }, { 127, -39, 127 }};

/*

* Discrete-Time IIR Filter (real)

* -------------------------------

* Filter Structure : Direct-Form II, Second-Order Sections

* Filter Order :

2

0

* Stable : Yes

* Linear Phase : No

*/

const

int DL[MWSPT_NSEC] = { 1,3,3,3,3,3,3,3,3,3,3 };

const int8_T DEN[MWSPT_NSEC][3] = {

{ 127, 0, 0 },

{ 127, 62, 8 },

{ 127, 55, 13 },

{ 127, 42, 21 },

{ 127, 24, 33 },

{ 127, 5, 46 },

{ 127, -14, 60 },

{ 127, -31, 74 },

{ 127, -46, 89 },

{ 127, -57, 103 },

{ 127, -66, 119

}

};

Slide163

Analysis of Quantization Error with MATLAB (Q.16)

5 October 2017

Veton Këpuska

163

Slide164

5 October 2017

Veton Këpuska

164

Analysis of Quantization Error with MATLAB (Q.8)

Slide165

End

5 October 2017

Veton Këpuska

165

Slide166

5 October 2017

Veton Këpuska

166