47
EE3054 Signals and Systems Lecture 2 Linear and Time Invariant Systems Yao Wang Polytechnic University Most of the slides included are extracted from lecture presentations prepared by McClellan and Schafer

Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

  • Upload
    lydiep

  • View
    229

  • Download
    8

Embed Size (px)

Citation preview

Page 1: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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

Page 2: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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

Page 3: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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

Page 4: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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

Page 5: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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]

Page 6: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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 ππ

Page 7: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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

Page 8: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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

Page 9: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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

Page 10: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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][][

Page 11: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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

Page 12: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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

Page 13: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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

DCONVDEMO: MATLAB GUI

Page 14: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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

Page 15: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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

CONVOLUTION via Synthetic Polynomial Multiplication

Page 16: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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

Convolution via Synthetic Polynomial Multiplication

� More example

Page 17: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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][][

Page 18: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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 δ=−−=

Page 19: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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]

Page 20: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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

Page 21: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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

TESTING Time-Invariance

Page 22: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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

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

Page 23: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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”

Page 24: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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

TESTING LINEARITY

Page 25: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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

� Examples systems that are linear and non-linear

Page 26: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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

LTI SYSTEMS

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

Page 27: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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

Page 28: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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

use LTI property!

Page 29: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

Properties of Convolution

� Convolution with an Impulse� Commutative Property� Associative Property

Page 30: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

Convolution with Impulse

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

Page 31: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

Commutative Property

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

Page 32: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

Associative Property

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

Page 33: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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][][

Page 34: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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

HARDWARE ATOMS

� Add, Multiply & Store∑=

−=M

kk knxbny

0][][

][][ nxny β=

]1[][ −= nxny

][][][ 21 nxnxny +=

Page 35: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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

FIR STRUCTURE

� Direct Form

SIGNALFLOW GRAPH

∑=

−=M

kk knxbny

0][][

Page 36: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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

Page 37: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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

Page 38: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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

� proof

Page 39: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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]

Page 40: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

CASCADE SYSTEMS

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

Page 41: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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

Does the order matter?

S1 S2

S1S2

Page 42: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

� proof

Page 43: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

Example

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

Page 44: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

Parallel Connections

h1[n]

h2[n]

x[n] y[n]+

h[n]=?

Page 45: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

Parallel and Cascade

h[n]=?

h1[n]

h3[n]

x[n] y[n]+

h2[n]

Page 46: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

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

Page 47: Systems Lecture 2 - New York University Tandon School of ...eeweb.poly.edu/~yao/EE3054/Ch5.4_5.8_L2.pdf · Signals and Systems Lecture 2 Linear and Time Invariant ... JH McClellan

READING ASSIGNMENTS

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