Systems Lecture 2 - Department of Electrical & Computer Engineering

Preview:

Citation preview

EE3054 Signals and Systems

Lecture 2Linear and Time Invariant

Systems

Yao WangPolytechnic University

Most of the slides included are extracted from lecture presentations prepared by McClellan and Schafer

1/30/2008 © 2003, JH McClellan & RW Schafer 2

License Info for SPFirst Slides

� This work released under a Creative Commons Licensewith the following terms:

� Attribution� The licensor permits others to copy, distribute, display, and perform

the work. In return, licensees must give the original authors credit.

� Non-Commercial� The licensor permits others to copy, distribute, display, and perform

the work. In return, licensees may not use the work for commercial purposes—unless they get the licensor's permission.

� Share Alike� The licensor permits others to distribute derivative works only under

a license identical to the one that governs the licensor's work.� Full Text of the License� This (hidden) page should be kept with the presentation

1/30/2008 © 2003, JH McClellan & RW Schafer 3

� General FIR System� IMPULSE RESPONSE

� FIR case: h[n]=b_n

� CONVOLUTION� For any FIR system: y[n] = x[n] * h[n]

Review of Last Lecture

][][][ nxnhny ∗=

][nh

}{ kb

1/30/2008 © 2003, JH McClellan & RW Schafer 4

GENERAL FIR FILTER

� FILTER COEFFICIENTS {bk}� DEFINE THE FILTER

� For example,

∑=

−=M

kk knxbny

0][][

]3[]2[2]1[][3

][][3

0

−+−+−−=

−=∑=

nxnxnxnx

knxbnyk

k

}1,2,1,3{ −=kb

Feedforward Difference Equation

1/30/2008 © 2003, JH McClellan & RW Schafer 5

GENERAL FIR FILTER� SLIDE a Length-L WINDOW over x[n]� When h[n] is not symmetric, needs to flip h(n) first!

x[n]x[n-M]

1/30/2008 © 2003, JH McClellan & RW Schafer 6

7-pt AVG EXAMPLE

CAUSAL: Use Previous

LONGER OUTPUT

400for)4/8/2cos()02.1(][ :Input ≤≤++= nnnx n ππ

1/30/2008 © 2003, JH McClellan & RW Schafer 7

==

00

01][

n

nnδ

Unit Impulse Signal

� x[n] has only one NON-ZERO VALUE

1

n

UNIT-IMPULSE

1/30/2008 © 2003, JH McClellan & RW Schafer 8

},0,0,,,,,0,0,{][ 41

41

41

41

��=nh

4-pt Avg Impulse Response

δδδδ[n] “READS OUT” the FILTER COEFFICIENTS

n=0“h” in h[n] denotes Impulse Response

1

n

n=0n=1

n=4n=5

n=–1

NON-ZERO When window overlaps δδδδ[n]

])3[]2[]1[][(][ 41 −+−+−+= nxnxnxnxny

1/30/2008 © 2003, JH McClellan & RW Schafer 9

What is Impulse Response?

� Impulse response is the output signal when the input is an impulse

� Finite Impulse Response (FIR) system:� Systems for which the impulse response has finite

duration� For FIR system, impulse response = Filter

coefficients� h[k] = b_k� Output = h[k]* input

1/30/2008 © 2003, JH McClellan & RW Schafer 10

FIR IMPULSE RESPONSE

� Convolution = Filter Definition� Filter Coeffs = Impulse Response

∑=

−=M

kknxkhny

0][][][

CONVOLUTION

∑=

−=M

kk knxbny

0][][

1/30/2008 © 2003, JH McClellan & RW Schafer 11

Convolution Operation� Flip h[n]� SLIDE a Length-L WINDOW over x[n]

x[n]x[n-M]

∑=

−=M

kknxkhny

0][][][

CONVOLUTION

1/30/2008 © 2003, JH McClellan & RW Schafer 12

More on signal ranges and lengths after filtering

� Input signal from 0 to N-1, length=L1=N� Filter from 0 to M, length = L2= M+1� Output signal?

� From 0 to N+M-1, length L3=N+M=L1+L2-1

1/30/2008 © 2003, JH McClellan & RW Schafer 13

DCONVDEMO: MATLAB GUI

1/30/2008 © 2003, JH McClellan & RW Schafer 14

� Go through the demo program for different types of signals

� Do an example by hand� Rectangular * rectangular� Step function * rectangular

1/30/2008 © 2003, JH McClellan & RW Schafer 15

CONVOLUTION via Synthetic Polynomial Multiplication

1/30/2008 © 2003, JH McClellan & RW Schafer 16

Convolution via Synthetic Polynomial Multiplication

� More example

1/30/2008 © 2003, JH McClellan & RW Schafer 17

MATLAB for FIR FILTER

� yy = conv(bb,xx)

� VECTOR bb contains Filter Coefficients

� DSP-First: yy = firfilt(bb,xx)

� FILTER COEFFICIENTS {bk} conv2()for images

∑=

−=M

kk knxbny

0][][

1/30/2008 © 2003, JH McClellan & RW Schafer 18

]1[][][ −−= nununy

POP QUIZ

� FIR Filter is “FIRST DIFFERENCE”� y[n] = x[n] - x[n-1]

� INPUT is “UNIT STEP”

� Find y[n]

<

≥=

00

01][

n

nnu

][]1[][][ nnununy δ=−−=

1/30/2008 © 2003, JH McClellan & RW Schafer 19

SYSTEM PROPERTIES

�� MATHEMATICAL DESCRIPTIONMATHEMATICAL DESCRIPTION�� TIMETIME--INVARIANCEINVARIANCE�� LINEARITYLINEARITY� CAUSALITY

� “No output prior to input”

SYSTEMy[n]x[n]

1/30/2008 © 2003, JH McClellan & RW Schafer 20

TIME-INVARIANCE

� IDEA:� “Time-Shifting the input will cause the same

time-shift in the output”

� EQUIVALENTLY,� We can prove that

� The time origin (n=0) is picked arbitrary

1/30/2008 © 2003, JH McClellan & RW Schafer 21

TESTING Time-Invariance

1/30/2008 © 2003, JH McClellan & RW Schafer 22

� Examples of systems that are time invariant and non-time invariant

1/30/2008 © 2003, JH McClellan & RW Schafer 23

LINEAR SYSTEM

� LINEARITY = Two Properties� SCALING

� “Doubling x[n] will double y[n]”

� SUPERPOSITION:� “Adding two inputs gives an output that is the

sum of the individual outputs”

1/30/2008 © 2003, JH McClellan & RW Schafer 24

TESTING LINEARITY

1/30/2008 © 2003, JH McClellan & RW Schafer 25

� Examples systems that are linear and non-linear

1/30/2008 © 2003, JH McClellan & RW Schafer 26

LTI SYSTEMS

� LTI: Linear & Time-Invariant� Any FIR system is LTI� Proof!

1/30/2008 © 2003, JH McClellan & RW Schafer 27

LTI SYSTEMS

� COMPLETELY CHARACTERIZED by:� IMPULSE RESPONSE h[n]� CONVOLUTION: y[n] = x[n]*h[n]

� The “rule”defining the system can ALWAYS be re-written as convolution

� FIR Example: h[n] is same as bk

� Proof of the convolution sum relation� by representing x(n) as sum of delta(n-k), and

use LTI property!

Properties of Convolution

� Convolution with an Impulse� Commutative Property� Associative Property

Convolution with Impulse

� x[n]*δ[n]=x[n]� x[n]*δ[n-k]=x[n-k]� Proof

Commutative Property

� x[n]*h[n]=h[n]*x[n]� Proof

Associative Property

� (x[n]* y[n])* z[n]=x[n]*(y[n]*z[n])� Proof

1/30/2008 © 2003, JH McClellan & RW Schafer 33

HARDWARE STRUCTURES

� INTERNAL STRUCTURE of “FILTER”� WHAT COMPONENTS ARE NEEDED?� HOW DO WE “HOOK” THEM TOGETHER?

� SIGNAL FLOW GRAPH NOTATION

FILTER y[n]x[n]∑=

−=M

kk knxbny

0][][

1/30/2008 © 2003, JH McClellan & RW Schafer 34

HARDWARE ATOMS

� Add, Multiply & Store∑=

−=M

kk knxbny

0][][

][][ nxny β=

]1[][ −= nxny

][][][ 21 nxnxny +=

1/30/2008 © 2003, JH McClellan & RW Schafer 35

FIR STRUCTURE

� Direct Form

SIGNALFLOW GRAPH

∑=

−=M

kk knxbny

0][][

1/30/2008 © 2003, JH McClellan & RW Schafer 36

FILTER AS BUILDING BLOCKS

� BUILD UP COMPLICATED FILTERS� FROM SIMPLE MODULES� Ex: FILTER MODULE MIGHT BE 3-pt FIR

� Is the overall system still LTI? What is its impulse response?

FILTERy[n]x[n]

FILTER

FILTER

++

INPUT

OUTPUT

1/30/2008 © 2003, JH McClellan & RW Schafer 37

CASCADE SYSTEMS

� Does the order of S1 & S2 matter?� NO, LTI SYSTEMS can be rearranged !!!� WHAT ARE THE FILTER COEFFS? {bk}

S1 S2

1/30/2008 © 2003, JH McClellan & RW Schafer 38

� proof

1/30/2008 © 2003, JH McClellan & RW Schafer 39

CASCADE SYSTEMS

� Is the cascaded system LTI?� What is the impulse response of the

overall system?

h1[n] h2[n]x[n] y[n]

CASCADE SYSTEMS

� h[n] = h1[n]*h2[n]!� Proof on board

1/30/2008 © 2003, JH McClellan & RW Schafer 41

Does the order matter?

S1 S2

S1S2

� proof

Example

� Given impulse responses of two systems, determine the overall impulse response

Parallel Connections

h1[n]

h2[n]

x[n] y[n]+

h[n]=?

Parallel and Cascade

h[n]=?

h1[n]

h3[n]

x[n] y[n]+

h2[n]

Summary of This Lecture

� Properties of linear and time invariant systems� Any LTI system can be characterized by its impulse

response h[n], and output is related to input by convolution sum: convolution sum: y[ny[n]=]=x[nx[n]*]*h[nh[n]]

� Properties of convolution� Computation of convolution revisited

� Sliding window� Synthetic polynomial multiplication

� Block diagram representation � Hardware implementation of one FIR� Connection of multiple FIR

• Know how to compute overall impulse response

READING ASSIGNMENTS

� This Lecture:� Chapter 5, Sections 5-5 --- 5-9

Recommended