Lecture 11 FIR Filters Fundamentals of Digital Signal Processing Spring, 2012 Wei-Ta Chu 2012/4/12 1
The Unit Impulse Sequence Any sequence can be represented in this way. The equation is true if k ranges over all the nonzero values of the sequence x[n]. The sequence is formed by using scaled shifted impulses to place samples of the right size at the right positions. 2
Unit Impulse Response Sequence When the input to the FIR filter is a unit impulse sequence,, the output is the unit impulse response, denoted as h[n]. n <0 0 1 2 3 M M+1 0 1 0 0 0 0 0 0 0 0 b 0 b 1 b 2 b 3 b M 0 0 3
Unit Impulse Response Sequence The impulse response h[n] of the FIR filter is simply the sequence of difference equation coefficients. Since h[n] = 0 for n<0 and for n>m, the length of the impulse response sequence h[n] is finite. This is why the system is called a finite impulse response (FIR) system. The plot of the impulse response for the case of the causal 3-point running-average filter. 4
The Unit-Delay System The operator that performs a delay or shift by an amount n 0 When n 0 = 1, the system is called a unit delay. x[n] are moved to the right by one time interval y[4] takes on the value of x[3], y[5] takes one the values of x[4], The delay system is actually the simplest of FIR filters; it has only one nonzero coefficient. E.g. 5
The Unit-Delay System The impulse response of the delay system is obtained by substituting for x[n] 6
Convolution A general expression for the FIR filter output can be derived in terms of the impulse response. Since the filter coefficients are identical to the impulse response values, we can replace b k by h[k] to obtain When the relation between the input and the output is expressed in terms of the input and the impulse response, it is called a finite convolution ( 迴旋 ) sum, and we say that the output is obtained by convolving the sequences x[n] and h[n]. 7
Convolution Example: x[n] = {2, 4, 6, 4, 2} and h[n] = {3, -1, 2, 1} n < 0 1 2 3 4 5 6 7 >7 x[n] 0 2 4 6 4 2 0 0 0 0 h[n] 0 3-1 2 1 h[0]x[n] 0 6 12 18 12 6 0 0 0 0 h[1]x[n-1] 0 0-2 -4-6 -4-2 0 0 0 h[2]x[n-2] 0 0 0 4 8 12 8 4 0 0 h[3]x[n-3] 0 0 0 0 2 4 6 4 2 0 y[n] 0 6 10 18 16 18 12 8 2 0 8
Convolution We can use a method similar to synthetic polynomial multiplication to form the output as the sum of shifted rows. Each shifted row is produced by multiplying the x[n] row by one of the h[k] values and shifting the result to the right so that it lines up with the h[k] position. A general form of convolution also applies to infinitelength signals 9
Implementation of FIR Filters The general definition of an FIR filter To compute the output of the FIR filter, we need (1) a means for multiplying delayed-input signal values by the filter coefficients (2) a means for adding the scaled sequence values (3) a means for obtaining delayed versions of the input sequence 10
Building Blocks (a) multiplier: (b) adder: (c) unit delay: 11
Block Diagrams The block-diagram notation defines the interconnection of the three basic building blocks to make more complex structures. This structure shows why the FIR filter is also called a feed-forward difference equation. One-to-one correspondence between the block diagram and the difference equation 12
Exercise 5.7 Determine the difference equation for the block diagram 13
Other Block Diagrams Direct form is just one possibility to express a difference equation. Four steps to derive the difference equation from the block diagram (1) Give a unique signal name to the input of each unit-delay block (2) Notice that the output of a unit delay can be written in terms of its input (3) At each summing node of the structure, write a signal equation. (4) You will have several equations involving x[n], y[n], and the internal signal names. Reduce them to one equation by eliminating variables. 14
Other Block Diagrams Transposed form 15
Linear Time-Invariant (LTI) System The properties of linearity and time invariance lead to simplifications of mathematical analysis and greater insight and understanding of system behavior. 16
Time Invariance A discrete-time system is said to be time-invariant if, when an input is delayed by n 0, the output is delayed by the same amount. The condition must be true for any choice of n 0. 17
Time Invariance Consider the example of the square-law system The square-law system is time-invariant 18
Time Invariance Consider the time-flip system The time-flip system is not time-invariant 19
Exercise 5.9 Consider the system defined as 20
Linearity Linear systems have the property that if and, then This condition must be true for any choice of and If the input consists of a sum of scaled sequences, then the corresponding output is a sum of scaled outputs corresponding to the individual input sequences. 21
Linearity A system can be tested for the linearity property by checking whether or not Example: 22
Linearity Consider the square-law system The square-law system is not linear. (it s nonlinear) 23
Exercise 5.10 Show that the time-flip system is a linear system 24
The FIR Case FIR systems satisfy both the linearity and time invariance conditions. Proof of time invariance: Define the signal v[n] to be x[n-n 0 ] 25
The FIR Case Proof of linearity 26
Convolution and LTI Systems Convolution is the general formula that allows us to compute the output from the input for any LTI system. Any signal x[n] can be represented as a sum of scaled and shifted impulse signals. The response to the input is the impulse response 27
Convolution and LTI Systems Time invariance gives us additional information: the response due to is We can write a whole family of input-output pairs 28
Convolution and LTI Systems Linearity gives us The Convolution Sum Formula 29
Convolution and LTI Systems All LTI systems can be represented by a convolution sum. Example: if h[n] is nonzero only in the interval Because the argument must lie in the range, so the range for is restricted to 30
Exercise 5.11 31