Section 3: Summary Section 4 Convolution integral (memorise this): f (t) = input g(t) = impulse response y(t) = y(t) = Evaluating Convolution Integrals output Z t −∞ g(t − τ ) f (τ ) dτ Way to find the output of a linear system, described by a differential equation, for an arbitrary input: • Find general solution to equation for input = 1. • Set boundary conditions y(0) = ẏ(0) = 0 to get the step response. A way of rearranging the convolution integral is described and illustrated. The differences between convolution in time and space are discussed and the concept of causality is introduced. The section ends with an example of spatial convolution. • Differentiate to get the impulse response. • Use convolution integral together with the impulse response to find the output for any desired input. 41 42 Convolution Summary Differential Equation ay + by + cy + d = f(t) Splitting up Integrals solve ay + by + cy + d = 1 with boundary conditions y(0) = 0 and y(0) = 0 Suppose we have a function: f (t) = a , t<0 b ,0<t<k ,k<t c Rt and we want to evaluate the integral −∞ f (τ ) dτ , we can split it up as follows: Step response differentiate Impulse response: g(t) Any Input: f(t) convolution y(t) = Z t −∞ Corresponding Output: y(t) Rt −∞ a dτ ,t<0 R0 Rk Rt a dτ + b dτ + −∞ 0 k c dτ ,k<t R0 Rt a dτ + −∞ 0 b dτ ,0<t<k g(t − τ ) f (τ ) dτ 43 44 Example Find the impulse response of d2y + 9y = f (t) dt2 hence find the output for (i) input f (t) = t, t > 0 and (ii) input f (t) = H(t) − H(t − 1). 1. Find the General Solution with f (t) = 1 3. Differentiate the step response to get the impulse response. dy 1 g(t) = = sin(3t) dt 3 4. Use the convolution integral to find the output for the required input. For part (i) the required input is a ramp starting at the origin: f (t) = t when t > 0 and f (t) = 0 otherwise. Complimentary function is y = A cos(3t)+B sin(3t) y(t) = Particular integral is y = 1 9 g(t − τ )f (τ ) dτ = −∞ Z t 1 = t sin(3t) − 9 27 1 + A cos(3t) + B sin(3t) General solution is y = 9 2. Set boundary conditions y(0) = ẏ(0) = 0 to get the step response. 0 3 sin(3(t − τ )) × τ dτ 0.6 1 9+A=0 y(t) 3B = 0 ⇒ A = −1 9 and B = 0 0.4 0.2 Thus the Step Response is y= Z t 1 (1 − cos(3t)) 9 0 0 1 2 3 4 5 t 45 46 Case (a): t < 0 For part (ii) the required input is a pulse of unit height and unit duration: f (t) = H(t) − H(t − 1). y(t) = Z t g(t − τ )f (τ )dτ −∞ R t g(t − τ ) × 0 dτ, t<0 −∞ R0 −∞ Rg(t − τ ) × 0 dτ + 0t g(t − τ ) × 1 dτ, 0 < t < 1 = R0 −∞ Rg(t − τ ) × 0 dτ + 01 g(t − τ ) × 1 dτ R + 1t g(t − τ ) × 0 dτ, t > 1 47 Rt −∞ g(t − τ ) × 0 dτ = 0 so y(t) = 0 for all t < 0. Case (b): 0 < t < 1 y(t) = = Z t 0 g(t − τ ) × 1 dτ = 1 (1 − cos(3t)) 9 Z t 1 0 3 sin(3(t − τ )) dτ Case (c): 1 < t y(t) = Z 1 0 g(t − τ ) × 1 dτ = Z 1 1 0 3 sin(3(t − τ )) dτ 1 1 cos(3(t − τ )) = 9 0 1 = {cos(3(t − 1)) − cos(3t)} 9 48 Part (ii) Another Way The input for part (ii) is composed of two step functions. We can therefore calculate the output using the 1 (1 − cos(3t)). step response, r(t) = 9 Alternate Convolution Integral The normal convolution integral y(t) = Input = H(t)−H(t−1) ⇒ Output = r(t)−r(t−1) Z t −∞ g(t − τ ) f (τ ) dτ can be inconvenient to compute when we have a complicated expression for g(t). Hence, for t > 1, y(t) = = 1 1 (1 − cos(3t)) − (1 − cos(3(t − 1))) 9 9 We would therefore like to derive an alternative version of the convolution integral that has a term of the form g(τ ) rather than g(t − τ ) as this will be easier to calculate in cases where g is a complicated expression. 1 {cos(3(t − 1)) − cos(3t)} 9 49 50 Example Arguments of f and g Substitute u = t − τ in the convolution formula. Assume all signals are zero for t < 0 and set the lower integral limit to zero. We have −du = dτ , Z t 0 g(t − τ )f (τ )dτ = − = Z 0 Z t 0 t g(u)f (t − u)du g(u)f (t − u)du As u is the variable of integration, we can call it anything, as it disappears when the integration has been evaluated. We therefore choose to rename u as τ . Hence: Z t 0 g(t − τ )f (τ )dτ = Z t 0 g(τ )f (t − τ )dτ Consider a linear system with impulse response g(t) = Note that everything is zero for t < 0, so we can use R y(t) = 0t f (t − τ )g(τ ) dτ . = 51 3t2 − 4t + 7 , t > 0 0 , otherwise Find the output for the input f (t) = t, (t ≥ 0) and f (t) = 0, (t < 0). y(t) = So it does not matter which way round you get the arguments to the functions in the convolutions integral, provided both functions are zero for t < 0. ( Z t 0 Z t 0 f (t − τ )g(τ ) dτ (t − τ ) × (3τ 2 − 4τ + 7) dτ t4 2t3 7t2 = − + 4 3 2 52 Spatial Convolution Spatial Convolution Example Systems with time-varying input & output. Causal: no output before the input that causes it. g(t) = 0, t < 0 Systems with input, output a function of position. An input can affect the output on either side. g(x) can be non-zero for any x. Consider a one-dimensional strip of a material that is known to deform linearly according to 1 g(x) = cosh(x) Calculate the deformation of a strip f(x) of material with spatial impulse re1 sponse as described on the previ0 2 x ous page in response to a uniform load of f (x) = 1.0 applied from x = 0 to x = 2. y(x) = −∞ = Z 0 = Z 2 g(x) x when subject to a unit force at x = 0. Z ∞ g(x − τ )f (τ ) dτ 1 × 0 dτ −∞ cosh(x − τ ) Z 2 1 + × 1 dτ 0 cosh(x − τ ) Z ∞ 1 × 0 dτ + 2 cosh(x − τ ) 1 dτ 0 cosh(x − τ ) = 2 arctan e2−x − arctan e−x n This is a spatial impulse response. 53 o 54 L x Variable Impulse Response a y L x x a y y Consider a taut string suspended between two points a distance L apart. It is subject to a uniform loading of K per unit length which results in a small displacement. If we knew the deformation caused by a point load, we could integrate in a style similar to the convolution integral to find the shape under the distributed load. If it was possible to have a spatial impulse response R g(x) then we could say y(x) = 0L g(x − τ )F (τ ) dτ 55 x y a But a normal impulse response is not possible because the shape of g changes depending on the position of the point load along the string. We have a function g(x, a) where the point load is at position a. The function g that gives the displacement under a point load depends on both the position of the load, a, and the position at which you want to know the displacement, x. 56 If we can find this g(x, a) we can work out the complete displacement under the continuous load K using y(x) = Z L 0 g(x, a)F (a) da = Z L 0 g(x, a)K da Now resolve vertically: T (sin(r1) + sin(r2)) = 1 Again approximate: cos(r1) ≈ cos(r2) ≈ 1 This gives us: T (tan(r1) + tan(r2)) = 1 L a d d + ⇒ a L−a x r1 r2 T1 d ⇒ T2 F y Segment 1 so Segment 2 To find g(x, a) we first work out the maximum displacement, d, for a point load, F = 1, at position a. Use the approximation: cos(r1) ≈ cos(r2) ≈ 1 Segment 2: x>a This gives us: T1 = T2. Call this tension T . 57 = 1 T Ld 1 = a(L − a) T a(L − a) d = TL This enables us to write down equations for the two straight segments of the g(x, a) function. Segment 1: x<a Resolve horisontally: T1 cos(r1) = T2 cos(r2) x x(L − a) d= a TL g(x, a) = g(x, a) = a(L − x) L−x d= L−a TL 58 Section 4: Summary Finally, we work out the shape of a string of length L with tension T under a uniform load of K per unit length. If f (t) = g(t) = 0 for all t < 0 then y(x) = Z L g(x, a)F (a) da = Z L g(x, a)K da = Z x = Z x a(L − x)K = 0 0 0 0 g K 2T seg 2 × K da + TL da + Z t 0 Z L x g seg 1 0 g(τ )f (t − τ )dτ Systems for which g(t) = 0 for all t < 0 are called causal systems. × K da Z L x(L − a)K x g(t − τ )f (τ )dτ = Z t TL Systems with time-varying inputs and outputs are causal. da x(L − x) 59 Systems that have inputs and outputs that vary as a function of spatial location can have g(x) 6= 0 for any x. 60