Discrete-Time Systems

Similar documents
Lecture 11 FIR Filters

Digital Signal Processing Lecture 4

Lecture 19 IIR Filters

VU Signal and Image Processing

Examples. 2-input, 1-output discrete-time systems: 1-input, 1-output discrete-time systems:

z-transforms Definition of the z-transform Chapter

ECE 308 Discrete-Time Signals and Systems

ELEN E4810: Digital Signal Processing Topic 2: Time domain

Analog vs. discrete signals

Digital Filter Structures. Basic IIR Digital Filter Structures. of an LTI digital filter is given by the convolution sum or, by the linear constant

Universiti Malaysia Perlis EKT430: DIGITAL SIGNAL PROCESSING LAB ASSIGNMENT 3: DISCRETE TIME SYSTEM IN TIME DOMAIN

Digital Signal Processing Lecture 5

Discrete-time signals and systems

UNIT 1. SIGNALS AND SYSTEM

III. Time Domain Analysis of systems

Linear Convolution Using FFT

Introduction to DSP Time Domain Representation of Signals and Systems

Digital Signal Processing, Homework 1, Spring 2013, Prof. C.D. Chung

ECE4270 Fundamentals of DSP Lecture 20. Fixed-Point Arithmetic in FIR and IIR Filters (part I) Overview of Lecture. Overflow. FIR Digital Filter

E : Lecture 1 Introduction


Digital Signal Processing Lecture 3 - Discrete-Time Systems

ELEG 305: Digital Signal Processing

2. CONVOLUTION. Convolution sum. Response of d.t. LTI systems at a certain input signal

Chap 2. Discrete-Time Signals and Systems

APPLIED SIGNAL PROCESSING

Discrete-Time Signals & Systems

Digital Signal Processing

LECTURE NOTES DIGITAL SIGNAL PROCESSING III B.TECH II SEMESTER (JNTUK R 13)

Module 3. Convolution. Aim

Cosc 3451 Signals and Systems. What is a system? Systems Terminology and Properties of Systems

An Fir-Filter Example: Hanning Filter

Solution 10 July 2015 ECE301 Signals and Systems: Midterm. Cover Sheet

Chapter 3 Convolution Representation

Multidimensional digital signal processing

Z - Transform. It offers the techniques for digital filter design and frequency analysis of digital signals.

6.02 Fall 2012 Lecture #11

Module 1: Signals & System

DSP Laboratory (EELE 4110) Lab#3 Discrete Time Signals

Digital Filters Ying Sun

Lecture 7 - IIR Filters

The objective of this LabVIEW Mini Project was to understand the following concepts:

EECE 301 Signals & Systems

Convolution. Define a mathematical operation on discrete-time signals called convolution, represented by *. Given two discrete-time signals x 1, x 2,

ENT 315 Medical Signal Processing CHAPTER 2 DISCRETE FOURIER TRANSFORM. Dr. Lim Chee Chin

信號與系統 Signals and Systems

Digital Signal Processing Module 1 Analysis of Discrete time Linear Time - Invariant Systems

Ch. 7: Z-transform Reading

R13 SET - 1

DIGITAL SIGNAL PROCESSING LABORATORY

信號與系統 Signals and Systems

DHANALAKSHMI COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING EC2314- DIGITAL SIGNAL PROCESSING UNIT I INTRODUCTION PART A

LTI H. the system H when xn [ ] is the input.

5. Time-Domain Analysis of Discrete-Time Signals and Systems

Homework #1 Solution

Properties of LTI Systems

DIGITAL SIGNAL PROCESSING LECTURE 1

How to manipulate Frequencies in Discrete-time Domain? Two Main Approaches

Introduction to Signals and Systems Lecture #4 - Input-output Representation of LTI Systems Guillaume Drion Academic year

8. z-domain Analysis of Discrete-Time Signals and Systems

Chapter 2 Time-Domain Representations of LTI Systems

Chapter Intended Learning Outcomes: (i) Understanding the relationship between transform and the Fourier transform for discrete-time signals

VLSI Signal Processing

ESE 531: Digital Signal Processing

Implementation of Discrete-Time Systems

Lecture 2 Discrete-Time LTI Systems: Introduction

Convolution and Linear Systems

Final Exam January 31, Solutions

(i) Represent discrete-time signals using transform. (ii) Understand the relationship between transform and discrete-time Fourier transform

Signals and Systems. Problem Set: The z-transform and DT Fourier Transform

hapter 8 Simulation/Realization 8 Introduction Given an nth-order state-space description of the form x_ (t) = f (x(t) u(t) t) (state evolution equati

Digital Signal Processing BEC505 Chapter 1: Introduction What is a Signal? Signals: The Mathematical Way What is Signal processing?

Signals and Systems Chapter 2

Lecture 5 - Assembly Programming(II), Intro to Digital Filters

EE123 Digital Signal Processing

6.02 Fall 2012 Lecture #10

Digital Signal Processing:


Digital Signal Processing. Midterm 1 Solution

Universiti Malaysia Perlis EKT430: DIGITAL SIGNAL PROCESSING LAB ASSIGNMENT 5: DIGITAL FILTER STRUCTURES

LTI Models and Convolution

ECE503: Digital Signal Processing Lecture 6

ESE 531: Digital Signal Processing

considered to be the elements of a column vector as follows 1.2 Discrete-time signals

ESE 531: Digital Signal Processing

UNIT-II Z-TRANSFORM. This expression is also called a one sided z-transform. This non causal sequence produces positive powers of z in X (z).

Problem Value Score No/Wrong Rec 3

The Convolution Sum for Discrete-Time LTI Systems

Notes 22 largely plagiarized by %khc

Z-Transform. x (n) Sampler

Rui Wang, Assistant professor Dept. of Information and Communication Tongji University.

Discrete-Time Signals and Systems

EEO 401 Digital Signal Processing Prof. Mark Fowler

(t ) a 1. (t ).x 1..y 1

Basic concepts in DT systems. Alexandra Branzan Albu ELEC 310-Spring 2009-Lecture 4 1

University Question Paper Solution

DSP Configurations. responded with: thus the system function for this filter would be

butter butter Purpose Syntax Description Digital Domain Analog Domain

DSP-I DSP-I DSP-I DSP-I

University of California Department of Mechanical Engineering ECE230A/ME243A Linear Systems Fall 1999 (B. Bamieh ) Lecture 3: Simulation/Realization 1

Transcription:

FIR Filters With this chapter we turn to systems as opposed to signals. The systems discussed in this chapter are finite impulse response (FIR) digital filters. The term digital filter arises because these filters operate on discrete-time signals The term finite impulse response arises because the filter output is computed as a weighted, finite term sum, of past, present, and perhaps future values of the filter input, i.e., M 2 yn b k xn k k M (5.) where both M and M 2 are finite One of the simplest FIR filters we may consider is a 3 term moving average filter of the form yn -- xn + + xn + xn 3 Lecture 5 (5.2) An FIR filter is based on a feed-forward difference equation as demonstrated by (5.2) Feed-forward means that there is no feedback of past or future outputs to form the present output, just input related terms Continuous-time filters will be discussed in the circuits and systems courses 5

Discrete-Time Systems Discrete-Time Systems A discrete-time system transforms or maps an input sequence (signal) xn into and output sequence (signal) yn via a function or operation denoted as yn Txn (5.3) xn T yn Some examples are: yn xn 3 minxn xn xn 2 xn xn -- xn + xn 2 The Running (Moving) Average Filter A three-sample causal moving average filter is a special case of (5.) yn -- xn + xn + xn 2, (5.4) 3 which uses no future input values to compute the present output Note: The term causal means that the present output, say 5 2

The Running (Moving) Average Filter can be calculated using MATLAB funcyn, utilizes only past and present signal values (no future values of the input) Consider a finite-length input sequence having support (nonzero values) over the interval n 3 xn 6 4 4 2-3 -2 - - 0 2 3 4 5 n For n 0 the 3 point causal moving average filter of (5.4) forms the output as y0 y2 -- x0+ x + x 2 3 -- 2 + 0 3 -- 0.333 3 -- 2 6+ 4+ 2 ----- 4 3 3 (5.5) If we put this into a spreadsheet we could write formulas into the cells that calculate the output sequence values as follows The output is yn 5 3

tions as follows The Running (Moving) Average Filter >> n -3:5; >> x [0 0-2 4 6 4 0 0] >> % We will learn about the filter function later >> y filter(/3*[ ],,x); >> stem(n,y,'filled') yn 4 4.67 3.33-3 -2 - -0.33.67 0.33 0 2 3 4.33 zero beyond n 5 n 5 The input/output relationship of (5.4) is known as a difference equation The action of the moving average filter has resulted in the output being smoother than the input Since only past and present values of the input are being used to calculate the present output, this filtering operation can operate in real-time A variation of the above 3-point averager is yn -- xn + + xn + xn 3 (5.6) which can be termed a centralized averager, since the previous input, the present input, the next input are used to form the output 5 4

The General FIR Filter This system is noncausal and cannot be computed in realtime, since the future input would not be available Inside the spreadsheet we have the following: Past Inputs relative to n 0 Present Input/Output relative to n 0 Future Inputs relative to n 0 Notice that the output is the same as before, except it occurs one sample index earlier To implement the causal filter we have to delay the output by one sample How we position and choose the width of the averaging window over the input signal are design choices What happens if we make the window wider? The General FIR Filter The class of causal FIR filters has difference equation of the form M yn b k xn k k 0 (5.7) 5 5

The General FIR Filter Note: When M 2 and b 0 b b 2 3, we have the special case of the causal 3-point moving average filter of (5.4) The text has defined the following terms regarding filtering with an Mth order causal FIR filter Example: An M 4 FIR Suppose that b k 2 023 and xn is as given in the following spreadsheet table y3 2 4 + 0 3 + 2 + 2 + 3 0 4 Fill-in the missing table entries 5 6

The General FIR Filter Example: Filtering A Windowed Noise Sequence In this example we create an input sequence composed of uniformly distributed random numbers x 2 2 for 0 n 40 and zero otherwise The filter coefficients b k represent both 3-point and 7- point moving average filters >> n -5:50; >> x [zeros(,5), rand(,4)-/2, zeros(,0)]; >> y3 filter(ones(,3)/3,,x); >> y7 filter(ones(,7)/7,,x); 0.5 x[n] 0 0.5 5 0 5 0 5 20 25 30 35 40 45 50 0.5 y 3 [n] 0 y 7 [n] 0.5 5 0 5 0 5 20 25 30 35 40 45 50 0.5 0 With a longer smoothing window the noise average approaches zero 0.5 5 0 5 0 5 20 25 30 35 40 45 50 Time Index (n) 5 7

The General FIR Filter The Unit Impulse Response Three interconnected concepts of this subsection are the unit impulse sequence, the unit impulse response, and the convolution sum. Unit Impulse Sequence: n A sequence having a nonzero value of one only when its argument is equal to zero, i.e., n 0 n, n 0 0, n 0 (5.8) The unit impulse sequence can be shifted right or left by integer by writing n 0 n n 0, n n 0 0, n n 0 (5.9) n -3-2 - n 2 0 2 3 n -3-2 - 0 2 3 n We can both time shift and amplitude scale the impulse sequence, such that a linear combination of them can be used to form any sequence, e.g., 5 8

The General FIR Filter xn 2n + 4n + 6n 2 + 4n 3 + 2n 4 (5.0) Each of the five scaled and time shifted impulses forms a single nonzero sample value of the complete sequence 2n 4n 6n 2 4n 3 2n 4 xn n... -2-0 2 3 4 5 6... 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 6 0 0 0 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 2 4 6 4 2 0 0 0 The generalization to the above is the ability to expand any sequence in this fashion, i.e., xn xk n k k + x n + + x0n + xn + x2n 2+ (5.) Unit Impulse Response Sequence: hn When we input to an FIR filter the sequence xn n, the filter output (assuming the filter is initially at rest) is the unit impulse response, denoted yn hn 5 9

The General FIR Filter n Discrete-Time Filter hn Note this definition holds for any discrete-time filter, not just FIR filters Example: 3-Point Moving Average Filter Impulse Response For this filter Using (5.7) b k 3 3 3 2 hn b k n k k 0 2 -- n k 3 k 0 -- n + n + n 2 3 (5.2) -3-2 hn - 0 /3 b k -- 3 3 -- 3 -- n 2 3 For a general FIR filter of (5.7) we observe that M hn b k n k k 0 (5.3) 5 0

The General FIR Filter Note in particular that the impulse response is finite, that is it extends over n 0 M, hence the term finite impulse response (FIR) system is justified Example: M 0 Triangle Impulse Response hn 6 k 5 n k k 0 Evaluate point-by-point and plot, e.g., 0 6 k 5 k 5 hn 6 5 4 3 2 6 k 5 k 4 6 5 2 2 4 6 8 0 2 n (5.4) The Unit-Delay System: yn xn n 0 When n 0, yn xn corresponds to a system imparting a unit delay A unit delay system is a special FIR filter where b k 0 (5.5) and the filter order is M 5

The General FIR Filter The impulse response of a delay by hn n n 0 n 0 system is (5.6) Convolution and FIR Filters It can be shown (more on this later) that a general expression of a filter s output can be expressed in terms of the impulse response and the input as yn k 0 hk xn k (5.7) This formula has a special name: convolution sum formula We say that yn is the convolution of xn and Example: Convolution Using the Text Table Method M hn Convolve xn 24642 with hn 3 2, where both sequence start at n 0 and are nonzero for the values given n n 0 0 2 3 4 5 6 7 n 7 sum down xn hn h0xn hxn h2xn 2 h3xn 3 yn 0 2 4 6 4 2 0 0 0 0 0 3-2 0 6 2 8 2 6 0 0 0 0 0 0-2 -4-6 -4-2 0 0 0 0 0 0 4 8 2 8 4 0 0 0 0 0 0 2 4 6 4 2 0 0 6 0 8 6 8 2 8 2 0 5 2

The General FIR Filter We can check the answers using MATLAB s filter function >> n 0:8; >> x [2 4 6 4 2 0 0 0 0]; >> h [3-2 ]; >> y filter(h,,x); >> y y 6 0 8 6 8 2 8 2 0 y[n] 8 6 4 2 0 8 6 4 2 0 0 2 3 4 5 6 7 8 Index n Example: Convolution Using an Alternate Table Method In this example we consider another approach to performing convolution of finite length sequences using a table Convolve xn 023 and hn 23 In the convolution sum formula we need to multiply the sequence hk by the sequence xn k for a fixed/given value of n 5 3

The General FIR Filter yn hk M k 0 hk xn k 0 M k xn k k multiply and add on the interval where h[k] is nonzero What is xn k relative to xk? x k is xk flipped from left to right about k 0 xk x k k n 0 n 2 n 2 0 n k xn k is xk flipped and shifted by n xk xn k k n 0 n 2 0 n n 2 n n k Check by plugging n n into xn k xn n n xn OK! Also plug n n 2 into xn k xn n n 2 xn 2 OK! 5 4

The General FIR Filter Using the above view of the convolution sum, we obtain an alternate table form for the convolution sum Check using MATLAB s filter function >> n 0:7; >> x [0 2 3 0 0 0 0]; >> h [ 2 3]; >> y filter(h,,x); >> y 0 3 7 0 2 9 0 2 0 8 y[n] 6 4 2 0 0 2 3 4 5 6 7 Index n 5 5

Using MATLAB s Filter Function The General FIR Filter We have been using the function filter() in the few examples, so how does it work? >> help filter FILTER One-dimensional digital filter. Y FILTER(B,A,X) filters the data in vector X with the filter described by vectors A and B to create the filtered data Y. The filter is a "Direct Form II Transposed" implementation of the standard difference equation: a()*y(n) b()*x(n) + b(2)*x(n-) +... + b(nb+)*x(n-nb) - a(2)*y(n-) -... - a(na+)*y(n-na) If a() is not equal to, FILTER normalizes the filter coefficients by a(). [Y,Zf] FILTER(B,A,X,Zi) gives access to initial and final conditions, Zi and Zf, of the delays. Zi is a vector of length MAX(LENGTH(A),LENGTH(B))-, or an array with the leading dimension of size MAX(LENGTH(A),LENGTH(B))- and with remaining dimensions matching those of X. From the help listing we see that it simply evaluates a general difference equation of the form N a k yn k b k xn k k 0 M k 0 (5.8) At the present time (Chapter 5) we do not have any feedback terms in our difference equation, so N 0 and we assume that a 0, resulting in (5.8) reducing to M yn b k xn k k 0 (5.9) 5 6

The General FIR Filter When using filter() to implement an FIR filter, we set the vectors a and b b 0 b b M Convolution in MATLAB We have seen how MATLAB s filter function can directly evaluate (number crunch) a difference equation for a given filter coefficient set and input sequence xn Convolution between any two finite support (duration) sequences can also be performed using the function conv() >> help conv CONV Convolution and polynomial multiplication. C CONV(A, B) convolves vectors A and B. The resulting vector is length LENGTH(A)+LENGTH(B)-. If A and B are vectors of polynomial coefficients, convolving them is equivalent to multiplying the two polynomials. Check this out using the previous example values for and xn >> h [ 2 3]; >> x [0 2 3]; >> y conv(x,h) y 0 3 7 0 2 9 b k hn We can also use the conv() function to perform polynomial multiplication, or at least obtain the coefficient set corresponding to polynomial multiplication, e.g. P x a 0 + a x+ a 2 x 2 P 2 x b 0 + b x+ b 2 x 2 (5.20) 5 7

Implementation of FIR Filters Let P 3 x P xp 2 x, then the coefficients are [c0 c c2...] conv([a0 a a2],[b0 b b2]) such that P 3 x c 0 + c x+ c 2 x 2 + (5.2) For example >> conv([ 2 3],[ - 2]) ans 3 6 So we conclude that + 2x + 3x 2 x + 2x 2 + x + 3x 2 + x 3 + 6x 4 (5.22) Verify! Implementation of FIR Filters The implementation of an FIR requires three basic building blocks multiplication addition signal delay We also need to be able to store filter coefficients in memory 5 8

Implementation of FIR Filters Building Blocks Multiplier: In a DSP system the multiplier must be fast and must have sufficient precision (bit width; think logic circuits) to support the desired application A high quality filter will in general require more multiplications than one of lesser quality, so throughput suffers if the multiplier is not fast There are classes of filters that do not require multiplies FIR filters having 50 coefficients or more are not that uncommon Adder: yn Multiply Add Delay yn x n xn + x 2 n Signal addition is a very basic DSP function In an FIR filter additions are required in combination with multiplications, hence DSP microprocessors feature multiply-accumulate (MAC) units Adders generally operate with just two inputs at a time 5 9

Unit Delay: yn xn The unit delay provides a one sample signal delay Implementation of FIR Filters A sample value is stored in a memory slot for one sample clock cycle, and then made available as an input to the next processing stage An M-unit delay requires M memory cells (note each memory cell must store say B-bits) configured as a shift register (B-bits wide) Block Diagrams Using the building blocks described above, we can construct a block diagram for say an M 3 FIR filter b 0 xn Unit Delay b 3 yn b k xn k k 0 xn Unit Delay b 2 xn 2 Unit Delay b 3 xn 3 yn 5 20

Implementation of FIR Filters Notice that the signal flow is strictly feed-forward, since all paths connecting the input to the output flow in the forward direction Feedback paths will be needed in the filters of Chapter 8 The structure of this block diagram is called direct form Other structures can be used to implement the same difference equation, and hence the same input/output relationship Once we understand how the direct form structure works, we can easily write the equations or draw the block diagram Example: M 3 Block Diagram to Difference Equation 3 xn v n Unit Delay xn 3 v 2 n Unit Delay xn 2 2 v 3 n Unit Delay xn 3 2 v 4 n yn 5 2

By inspection we know that yn Implementation of FIR Filters 3xn + 3xn + 2xn 2 2xn 3 If we were not familiar with this form, we can write an equation for the output by adding some additional labels, and then making substitutions, e.g., yn v n + v 2 n+ v 3 n + b 0 xn + b xn v 4 n + b 2 xn 2 +b 3 xn 3 Given a new unfamilar block diagram requires a procedure to derive the difference equation Step (a) (b) (c) (d) Description Create a signal label for the input to each unit delay Delay outputs can be written in terms of the delay inputs At each summing node write an equation Reduce the multiple equations you obtain via a series substitutions similar to solving a system of equations 5 22

Implementation of FIR Filters Example: A Transposed Block Diagram b 3 xn v 3 n b 2 Unit Delay v 2 n b Unit Delay v n b 0 Unit Delay To discover the difference equation we begin by writing equations at summer output yn v n v 2 n v 3 n b 0 xn + v n Next make substitutions, beginning with yn b xn + v 2 n b 2 xn + v 3 n b 3 xn v n b 0 xn + b xn + v 2 n 2 yn Next substitute in v 2 n 5 23

Linear Time-Invariant (LTI) Systems yn b 0 xn + b xn + b 2 xn 2+ v 3 n 3 Finally substitute in yn The block diagram studied in the last example implements a transposed direct form Notice that the order of operation is different from the direct form, specifically the signal flow is in the opposite direction and the input and output are swapped Changing the order of operations can be important in applications where hardware architectures come into play, e.g., VLSI designs or particular FPGA structures for high speed DSP Finite word-length effects also come into play when choosing the block diagram topology Linear Time-Invariant (LTI) Systems The FIR filter we have been considering has two important properties that need further discussion linearity time invariance v 3 n b 0 xn + b xn + b 2 xn 2 + b 3 xn 3 In this section of the notes and text, a transformation of the input signal xn to the output signal yn is denoted via 5 24

Linear Time-Invariant (LTI) Systems xn (text) or xn yn (notes) (5.23) This notation applies to difference equation systems as well as instantaneous systems such as yn x 2 n Time Invariance yn A discrete-time system is time-invariant if for an input delayed/shifted by n 0, the output is also delayed by the same amount, i.e., xn n 0 yn n 0 (5.24) given that xn yn and (5.24) holds for any n 0 Example: yn axn + b Using the above proof template, we let wn axn n 0 + b, that is we delay the input before it enters the system 5 25

Linear Time-Invariant (LTI) Systems Now we compare yn n 0 to wn yn n 0 axn + b n n n0 yes! wn so the system is time-invariant axn n 0 + b Example: yn nxn Let wn nxn n 0 Note the delay is applied before being input to the system Now compare the delayed output to so the system is not time-invariant wn yn n 0 n n 0 xn n 0 nxn n 0 wn Linearity For a system to be linear, superposition must hold, meaning that given x n y n and x 2 n y 2 n, then it follows that for all values of xn yn and x n y n x 2 n As a special case results in + + y 2 n (5.25) 5 26

Linear Time-Invariant (LTI) Systems xn x n + x 2 n y n + y 2 n yn (5.26) Also if 0 we have xn x n y n yn (5.27) Example: Revisit yn nxn Using the above proof template, wn nx n + nx 2 n and yn nx n + x 2 n nx n + nx 2 n 5 27

Linear Time-Invariant (LTI) Systems Thus we see that yn wn, so the system is linear Example: yn axn + b Again using the template, wn ax n + b + ax 2 n + b ax n + x 2 n+ b+ and yn ax n + x 2 n+ b ax n + x 2 n+ b The last term of wn does not agree with the last term of yn, thus the system is not linear Note that if b 0, then linearity holds The FIR Case A special case of interest is the FIR filter system we have been studying Time Invariance: Let wn M vn xn n 0 initially, in forming wn b k vn k b k xn k n 0 k 0 M k 0 M k 0 b k xn n 0 k 5 28

Convolution and LTI Systems Next, Which proves time invariance! Linearity: Input Which proves linearity! yn b k xn k k 0 An FIR filter is an example of a linear time-invariant (LTI) system Convolution and LTI Systems M M yn n 0 b k xn n 0 k x n + k 0 x 2 n yn b k x n k + x 2 n k k 0 M b k x n k+ b k x 2 n k k 0 y n + y 2 n k 0 Will will now establish that the impulse response characterizes any LTI system, and the convolution of the input with the impulse response produces the output. M 5 29

Derivation of the Convolution Sum Step : For any signal we can write Convolution and LTI Systems (5.28) where in the most general case the sum runs from to + Step 2: Time invariance means that for any l xn Step 3: Apply (5.28) on both sides to the system and use linearity to write (5.29) For the case of an input signal having support over the entire axis, n, the convolution sum formula becomes for all LTI systems l xl n l n n 0 hn n 0 so xn l l xl hn xn yn l l xl n l xl hn l l yn xl hn l l (5.30) 5 30

Convolution and LTI Systems Example: FIR Convolution For the special case of hn nonzero over the interval 0 n M, the sum limits of (5.30) are reduced since hn l is zero outside the interval 0 n l M Solving the inequality for l we have so Example: Proof that (5.7) and (5.3) are Equivalent (5.3) Starting from (5.3) we change variables in the sum formula by letting k n l With yn n M l n l n M k n l it follows that l n k With k the new summation variable, the lower sum limit of (5.3) becomes l n M k n n M M The upper sum limit becomes k 0 M n xl hn l l n k n n 0, so yn xn khk xn khk k 0 (5.32) Where the last step follows from the fact that changing the order of the summation does not alter the sum M 5 3

Some Properties of LTI Systems Convolution as an Operator: yn Convolution and LTI Systems When viewed as an operator we are saying that yn is the result of convolving the sequence xn with hn Example: Convolving with n n 0 When one of the two signals is an impulse sequence, we get a result known as the sifting property (5.33) The impulse sequence inside the sum turns on only when k n n 0, so only one term of the sum is retained (sifted out) Commutative Property: In an earlier example we showed that the convolution sum for FIR filtering can be written in two ways; this established the commutative property as a special case In general terms we can write Now let in the sum to obtain xn *hn xn *n n 0 xk n n 0 k yn k xn n 0 xn *hn k n l xn *hn l xl hn hn *xn l (5.34) 5 32

Cascaded LTI Systems xn *h n xn k k + Associative Property: k xn x n * x 2 n * x 3 n k hk hk hn *xn x n * x 2 n * x 3 n (5.35) This property applies when three signals and two convolutions are involved It says that either convolution operation may be done first proof in text Cascaded LTI Systems Cascaded LTI systems occur frequently in practice, e.g., a signal must go through two filtering operations before the final result is obtained xn LTI # h n wn LTI #2 h 2 n yn The natural question is how is yn related to xn, h n, and h 2 n? To start with we know that Likewise we know that yn wn xn *h n wn *h 2 n 5 33

Cascaded LTI Systems Putting these two results together we obtain yn xn *h n*h 2 n (5.36) From the commutative associative properties, we can also write that yn xn * h n*h 2 n xn * h 2 n*h n xn *h 2 n*h n (5.37) which establishes that we may change the order of the LTI systems in the cascade xn LTI #2 h 2 n vn LTI # h n yn Thus when we have a cascade of LTI systems the equivalent impulse response is hn h n*h 2 n h 2 n*h n Example: 4-point Moving Average and Backwards Difference (5.38) Consider the cascade of a moving average system with impulse response h n 4,0n3 0, otherwise 5 34

Cascaded LTI Systems and a first-order backwards difference system, which has difference equation yn wn wn which implies h 2 n n n xn h n wn h 2 n yn We know that the impulse response of the cascade, given by h 3 n h n*h 2 n k h kh 2 n k h 3 n, is We can again use the table method introduced in the text or the alternate table method introduced in the notes, to find h 3 n Since h n has support on the interval [0, 3], the sum limits run from k 0 to k 3 The support interval for h 3 n runs [0+0, 3+] [0, 4] 5 35

Cascaded LTI Systems h k vs. k h 2 n k n 0 n n 2 n 3 n 4 -- 4 -- 4 -- 4 -- h 4 3 n 0-0 0 0 0 0 /4 0 0-0 0 0 0 0 0 0 0-0 0 0 0 0 0 0 0-0 0 0 0 0 0 0 0-0 -/4 We can check this using MATLAB s convolution function >> conv([ ]/4,[ -]) ans.25000 0 0 0 -.25000 % first point at n0 We can now draw the direct form block diagram corresponding to h 3 n xn xn 2 xn 3 xn 4 xn Unit Delay Unit Delay Unit Delay Unit Delay -- 4 -- 4 yn 5 36

Cascaded LTI Systems Filtering a Sinusoidal Sequence with a Moving Average Filter To provide motivation for studying the frequency response of FIR filters, in this section we will consider the output of a 4- tap ( M 3) moving average filter when xn cosˆ 0n Specifically we will consider >> n 0:00; >> h [ ]/4; >> x cos(pi/8*n); >> x2 cos(pi/2*n); >> y filter(h,,x); >> y2 filter(h,,x2); ˆ 0 8and 4 ˆ 0 8 (6 samples per cycle) 0.5 x [n] 0 0.5 0 0 20 30 40 50 60 70 80 90 00 Output signal is still a sinusoid 0.5 y [n] 0 0.5 0 0 20 30 40 50 60 70 80 90 00 Index n The output signal at ˆ 0 8 is still a sinusoid, but the amplitude is reduced and there is small amount of phase shift 5 37

Cascaded LTI Systems ˆ 0 4 (4 samples per cycle) 0.5 x 2 [n] 0 0.5 0 5 0 5 20 25 30 35 40 y 2 [n] 0.5 0 After a brief transient, the output signal disappears 0.5 0 5 0 5 20 25 30 35 40 Index n For the case of ˆ 0 4 the output signal disappears This filter must have a special property that allows at least sinusoids of a particular frequency to be blocked In Chapter 6 we study the frequency response, and will discover how it is possible for the above to occur 5 38