SIMON FRASER UNIVERSITY School of Engineering Science ENSC 8 Linear Systems Solutions to Assignment Spring Design a Filter There is no single best way to solve this problem In fact, there is no single best solution, since it depends on how you trade off the size of responses to the short and long blips However, what you have learned so far about convolution should lead most of you to the type of solution outlined below If you visualized a time-reversed impulse response sliding across the input waveform illustrated in the question, you noted a few points: * In the slowly varying portions, the input is almost constant Therefore, if the net area under the filter h(t) is zero (ie, equal positive and negative areas) then the output is almost zero, as desired This is analogous to the first difference operator (+, -) in discrete time, which produces zero if the input does not change * When we hit a long blip, we want a large output at some instant, so we'll design for that time To obtain the large output, we want the time-reversed h(t) to have the same sign as the input blip everwhere they overlap There is no reason for the impulse response to be longer than the long blip Consequently, the sign pattern of the impulse response loos lie a time-reversed long blip * So could we use the time-reversed long blip itself as the impulse response? The behaviour would be a little lie resonance, except that the blip and the filter are both of finite length * The maximum positive response of such a filter to the short blip is only / that of its response to the long blip We can probably live with that The result of this line of reasoning is the filter below Its amplitude doesn't matter, as long as you now its value and that of the input so that you can set a threshold appropriately to distinguish short from long blips The response of this filter to the input illustrated on the question sheet is setched below
Solve the Difference Equation (a) As a first step, find the particular solution Substitute y p ()=B(/) in the E: B B 8 B 5 from which B= and y p ( ) Next, find the homogeneous solution: y h ( ) y h ( ) 8 y h ( ) Trial solution is y h ()=Aβ Substitute and factor A β β β 8 There are two solutions: β β so the homogeneous solution is y h ( ) A A and the complete solution is y( ) y h ( ) y p ( ) A A
The form of the input is valid down to =, so we fit the parameters A and A at = and =, although there is no harm in fitting at later points We obtain the values of the solution at those times by numerical iteration of the E, summarized in the table below, where the initial conditions are y(-)= and y(-)= for the zero state response: x() y() 6667 Solving for the parameters requires a x linear equation set A A A A A A A A 5 from which we obtain A 6 A 6 and the complete solution y( ) 6 6 (b) The homogeneous equation decays to zero exponentially, so the system is BIBO stable (c) For the unit pulse response, we can follow the same steps as in part (a) First, the particular solution The impulse is a constant (ie zero) everywhere but at =, so we assume a particular solution of the form y p ()=C Substitution into the E gives, for >, C or C= 8 so the particular solution is zero for > We still have the homogeneous solution from part (a), so the complete solution is
h( ) A A This form of the solution is valid down to =, so we'll fit at = and = Iterate to find those values, as shown below δ() h() 5 A A A A 5 Soving the x set gives A A 6 and the impulse response h ( ) 6 Were not finished yet, though We have to specify the values for = Our expression gives h ( ) = h ( ) = h ( ) = 5 and, of these, only the first one is wrong We have a couple of ways to specify the final result: or h( ) 6 δ ( ) h( ) 6 if otherwise Incidentally, if we had fitted the complete solution at = and =, we would have found both parameters to be zero, giving an identically zero impulse response - clearly, an incorrect conclusion
Simulation Diagrams The simulation diagrams are setched below without explanation (consult the notes if you got it wrong) (a) FIR filters (b) IIR filter 5
5 State Variable Formulation I will use v (), v () and v () to denote the outputs of the delay blocs, right to left, as shown below To operate the filter we do the following: while x > read_new_input v x v v v y v v v v v v v v the "while" condition just means "forever" v is the next value of v delay bloc updates must be done in this order output y (b) Suitable state variables are the delay bloc outputs We have v ( ) v ( ) v ( ) v ( ) v ( ) v ( ) v ( ) v ( ) x( ) y( ) v ( ) v ( ) 6
or, in vector and matrix form, v ( ) v ( ) v ( ) v ( ) v ( ) v ( ) x( ) y( ) ( ) v ( ) v ( ) v ( ) which we write as v( ) A v( ) b x( ) y( ) c v( ) 6 State Variable Representation The circuit is redrawn below with voltages and current labelled We have the basic current and voltage relationship for the capacitor and inductor v' C ( t) C i C ( t) i' L ( t) L v L ( t) which shows why cap voltage and inductor current are good choices for state variables From KCL, the cap current is the same as the inductor current, so v' C ( t) C i L ( t) From KVL around the loop, x( t) v C ( t) R i L ( t) L i' L ( t) 7
Putting in vector and matrix form and dropping the explicit time dependence v' C i' L L C R L v C i L L x( t) v' A v b v The output is the resistor voltage, so y v C ( R ) y c v i L 8