Presentation is loading. Please wait.

Presentation is loading. Please wait.

MM3FC Mathematical Modeling 3 LECTURE 3

Similar presentations


Presentation on theme: "MM3FC Mathematical Modeling 3 LECTURE 3"— Presentation transcript:

1 MM3FC Mathematical Modeling 3 LECTURE 3
Times Weeks 7,8 & 9. Lectures : Mon,Tues,Wed 10-11am, Rm.1439 Tutorials : Thurs, 10am, Rm. ULT. Clinics : Fri, 8am, Rm.4.503 Dr. Charles Unsworth, Department of Engineering Science, Rm Tel : ext

2 This Lecture What are we going to cover & Why ?
The Convolution Sum. (A new form of operator that we use in signal processing) Block Diagrams. (Allow for a pictorial representation of a filter) Linear Time-Invariant (LTI) Systems. (Measure 2 properties of a system – Linearity - Time-Invariance) (- if a system is LTI then it has special features) Cascaded LTI Systems. (Connect filters together)

3 Convolution & FIR filter
The ‘FIR general difference equation’, y[n], and its ‘impulse response’, h[n], is given by : Now the filter co-efficients of the FIR are identical to those used in the FIR’s impulse response. Thus, we can replace (bk) by the impulse response h[ k] to obtain. When the input and ouput of an FIR filter is expressed in terms of the input and the impulse reponse. We say the output y[n] is obtained by ‘convolving’ the sequences x[n] and h[n]. This is called a ‘finite convolution sum’. Let k be –ve for a non-causal. … (3.1)

4 Computing the Output of a Convolution
A way of doing long hand convolution, so to speak, is as follows. Example 1 : Convolve the input x[n] = { 2, 4, 6, 4, 2 } with the impulse response h[n] = { 3, -1, 2, 1 }. First of all we write each of the signals out on separate lines. Then we mutiply the x[n] row by each of the h[n] rows in turn. And shift the result to the right, to line up with its h[n] position. n x[n] h[n] h[0]x[n-0] h[1]x[n-1] h[2]x[n-2] h[3]x[n-3] y[n] Shift one along

5 Example 2 : Compute the convolution sum for a length 4 filter with coefficients h[n] = { 1, -2, 2, 1 } for the signal x[n] n x[n] h[n] Convolution in MATLAB : The conv( ) function, in Matlab, performs convolution of finite signals. xn = [ ]; hn = transpose([ 1 – ]); % Note h[n] must be transposed first yn = conv(hn,xn); % Produces the same output as in the example above.

6 Implementation of FIR filters
Let’s recall our ‘general definition of the FIR’ again from 2.3 : We can see in order to compute the output of the ‘FIR’ we need the following : A means for obtaining delayed versions of the input sequence To perform the x[n-k] bit. A means for ‘multiplying’ delayed-input signals by the filter co-efficients To perform the (bkx[n-k]) bit. A means of ‘adding’ scaled sequence values To perform the () bit. We will find it useful to represent the above operations as ‘block diagrams’. Such representations will lead us to new insights into the properties of system and alternative ways to implement a system.

7 The Basic Building Blocks
x[n] y[n] The ‘Multiplier’. The first elementary operator multiplies a signal x[n] by a constant (). y[n] = x[n] The multiplier is an FIR filter with M=0, b0=  and impulse response h[n] = [n]. The ‘Adder’. The second elementary system takes two inputs and adds the same time intervals together. It is not an FIR filter because it has more than one input. However, it is a crucial building block in FIR filters And the ‘Unit-delay’ operator. Performs a delay of one unit of time. x1[n] x2[n] y[n] x[n] y[n] Unit delay

8 y[n] = 1/3( x[n] + x[n-1] + x[n-2] )
Block Diagrams Let’s express our 3-point running average causal filter in a block diagram : y[n] = 1/3( x[n] + x[n-1] + x[n-2] ) The signal x[n] comes in from the left and splits off into two parts. The 1st part, of x[n], is multiplied by b0 = 1/3 to form b0x[n]. The 2nd part, of x[n], is delayed to form x[n-1]. x[n-1] then splits into two parts, just like x[n] did. The 1st part, of x[n-1], is then multiplied by b1 = 1/3 to form b1x[n-1]. b1x[n] is then added to b0x[n]. And so the system continues to produce y[n]. b0 = 1/3 y[n] x[n] x[n-1] Unit delay x[n-2] b1 = 1/3 b2 = 1/3

9 y[n] = 3x[n-1] + 2x[n] + 6x[n+1]
Example 3 : Compute the difference equation for this system. Example 4 : Draw a block diagram for the difference equation : y[n] = 3x[n-1] + 2x[n] + 6x[n+1] 3 y[n] x[n] x[n-1] Unit delay x[n-2] 2 -1 x[n-3] -2

10 Linear Time-Invariant (L.T.I.) Systems
A greater understanding of a system can be achieved by examining 2 of its properties. The systems ‘linearity’ and its ‘time-invariance’. If the system is both ‘linear’ and ‘time-invariant’ then we say it is a ‘linear time-invariant’ (LTI) system. Time-Invariance ~ When the input is delayed by (n0) the output is delayed by the same amount. x[n – n0]  y[n - n0] … (3.2) x[n] x[n- n0] Unit delay y[n– n0] System = Equilvalent if ‘Time – Invariant’ x[n] y[n] y[n– n0] System Unit delay

11 = Linearity ~ This is the principle of superposition property.
It states when we have two signals where, x1[n]  y1[n], x2[n]  y2[n]. x1[n] + x2[n]  y1[n] + y2[n], where  &  are constants. … (3.3) y1[n] y2[n] x1[n] x2[n] System  y1[n]  y2[n] y1[n] + y2[n] = Equilvalent if ‘Linear’ x1[n] x2[n] System  x1[n]  x2[n] x1[n] + x2[n] y1[n] + y2[n]

12 The best way to answer this is by using a table format.
Example 5 : Take the finite-input sequences x1[n] = { 0, 2, 4, 6, 4, 2, 0 } and x2[n] = { 0, 2, 3, 2, 0, 0 } and determine whether the ‘ Order 2, causal FIR filter system with bk = { } is a ‘linear time invariant’ (LTI) system. The best way to answer this is by using a table format. First Time-Invariance (only need to use one signal) The ‘Order 2, causal FIR’ is defined as : n = x1[n] Delay System System Delay = Time- Invariant

13  Second, linearity (need to use both signals).
Choose some arbitary scaling factors  & . Let’s choose  = 2 &  = -1. n = x1[n] System times( = 2) … 1) x2[n] System times( = -1) … 2) Add 1)&2) times( = 2) System … 3) times( = -1) System … 4) Add 3)&4) = L i n e a r

14 Properties of LTI Systems
Thus the ‘ Order 2, Causal FIR filter’ is a LTI system. In fact, ‘all FIR filters are LTI systems’. The properties of convolution are the properties of LTI systems. By understanding these properties we can cascade LTI systems together and work out their output much easier. The Convolution Operator From now on we will denote the convolution between two things by a ‘convolution operator’ (*). And we will include infinite limits for the most general cases where the signals are not of finite duration. Convolution is both ‘commutative’ and ‘associative’. Thus, y[n] = x[n] * h[n] = h[n] * x[n] ‘Commutative Property’ y[n] = x1[n] * (x2[n] * x3[n]) = (x1[n] * x2[n]) * x3[n] ‘Associative Property’ … (3.4) … (3.5)

15 Similary, convolution with an Impulse gives :
Writing things down in this way help us think of convolution in an operational way. Similary, convolution with an Impulse gives : x[n] * [n – n0] = x[n – n0] This is an important result. Stating, to convolve a sequence with an impulse at n = n0. Simply shifts the whole sequence to have an origin of (n0). … (3.6)

16 Cascaded LTI Systems In a ‘cascaded’ system the ouput of the first system is the input to the second system. Property : Two LTI systems in cascade can be implemented in any order. (This is a direct consequence of the commutative & associative properties of convolution that define LTI systems). x[n] x[n]*h1[n] LTI 1 h1[n] LTI 2 h2[n] ( x[n] * h1[n] ) * h2[n] x[n]*h2[n] ( x[n] * h2[n] ) * h1[n] = x[n] * ( h2[n] * h1[n] ) = x[n] * ( h1[n] * h2[n] ) = ( x[n] * h1[n] ) * h2[n]

17 h[n] = h1[n] * h2[n] = h2[n] * h1[n]
Now let’s look at the impulse response for the same cascaded system. Thus, ‘impulse responses’ from the 2 or more LTI cascaded systems can be written as the ‘impulse response’, h[n], from a ‘single equivalent LTI system’ is : h[n] = h1[n] * h2[n] = h2[n] * h1[n] This is a very powerfull result. Let’s illustrate it. [n] h1[n] LTI 1 LTI 2 h2[n] h1[n] * h2[n] h2[n] * h1[n] = ( h1[n] * h2[n] ) … (3.7)

18 Example 6 : Determine the impulse response from the 2 cascaded systems defined as :
h1[n] =  n  3 and h2[n] =  n  2 0 otherwise otherwise From the results, we know that the final system will have impulse response h[n] = h1[n] * h2[n] We can determine this by a convolution table of the impulse responses. n h1[n] h2[n] h2[0]h1[n-0] h2[1]h1[n-1] h2[2]h1[n-2] h[n] { { h[n] = [n] + 2 [n-1] + 3 [n-2] + 3 [n-3] + 2 [n-4] + [n-5]

19 Therefore, the equivalent impulse response is :
Therefore, the system can be implemented by the single difference equation. Or by the pair of difference equations. where, ck = { 1, 2, 3, 3, 2, 1 } where, ck = { 1, 2, 3, 3, 2, 1 } where, ak = { 1, 1, 1 } where, bk = { 1, 1 } This illustrates an important point. The pair require only 5 additions as the coefficients are unity. The single system requires 5 additions and 4 multiplications by coefficients that are not equal to unity. Thus, the existence of alternative filter implementations is significant.

20 Example 7 : Sketch out the 2 equivalent systems from Example 6.


Download ppt "MM3FC Mathematical Modeling 3 LECTURE 3"

Similar presentations


Ads by Google