EECS 105 Fall 2004, Lecture 3 Lecture 3: Phasor notation, Transfer Functions Prof. J. S. Smith Department of EECS University of California, Berkeley EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith Context z In the last lecture, we discussed: – – z how to convert a linear circuit into a set of differential equations, How to convert the set of differential equations into the frequency domain, a set of algebraic equations. In this lecture we will cover: – – – – Analyzing circuits with a sinusoidal input, (in the frequency domain, a single frequency at a time) How to simplify our notation with Phasors Solving a couple of example circuits How to present information about the circuit directly in the frequency domain using diagrams of amplitude and phase at different frequencies (Bode plots) Department of EECS University of California, Berkeley 1 EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith →Equation For any linear circuit, you will be able to write: L1{vout (t )} = L 2 {vin (t )} = d d2 avin (t ) + b1 vin (t ) + b2 2 vin (t ) + L dt dt + c1 ∫ vin (t ) + c2 ∫∫ vin (t ) + c3 ∫∫∫ vin (t ) + L L {}, L {} 1 2 Here represent Linear operators, that is, if you apply it to a function, you get a new function (it maps functions to functions), and linear operators also have the property that: L{a ⋅ f (t ) + b ⋅ g (t )} = a ⋅ L{ f (t )} + b ⋅ L{g (t )} Department of EECS University of California, Berkeley EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith Single frequency approach z z Another way to look at the situation is that since the circuit is linear, we can view any input as the sum of sin waves at various amplitudes, frequencies, and phases. (each piece of the Fourier transform) If we can under the circuit for an arbitrary sinusoidal input, we then can figure out what the circuit will do for an arbitrary input, or inputs. (Just break all the inputs up into sinusoids, put them through one at a time, and then add the results for each back up at the end, and that’s your answer!) Department of EECS University of California, Berkeley 2 EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith Sinusoidal stimulus z z We are going to analyze circuits for a single sinusoid at a time which we are going to write: vin (t ) = Vi sin(ωt + φ ) But we are going to use exponential notation vin (t ) = Vi sin(ωt + φ ) = Vi (e j (ωt +φ ) − e − j (ωt +φ ) ) / 2 vin (t ) = (Vi e j (φ ) e j (ωt ) − Vi e − j (φ ) e − j (ωt ) ) / 2 1 vin (t ) = [Vi e j (φ ) ]e j (ωt ) + C.C. 2 Complex conjugate (same as first term, but with (j)→(-j) wherever it occurs) Department of EECS University of California, Berkeley EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith Sin in→Sin at every node! It is especially interesting because any voltage or current in our circuit, if this is the only input, must also be sinusoidal with the same frequency, and so can also be written in this form. 1 vany (t ) = [Vany e j (φ ) ]e j (ωt ) + C.C 2 1 iany (t ) = [ I any e j (φ ) ]e j (ωt ) + C.C 2 Because our equations will be linear, the same things will happen to the complex conjugate terms as happen to the first terms, so they will just tag along Department of EECS University of California, Berkeley 3 EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith Differentiating or integrating z This form is particularly useful because it is easy to differentiate or integrate with respect to time 1 vany (t ) = [Vany e j (φ ) ]e j (ωt ) + C.C. 2 d 1 vany (t ) = ( jω ) [Vany e j (φ ) ]e j (ωt ) + C.C. dt 2 1 1 v ( t ) dt = [Vany e j (φ ) ]e j (ωt ) + C.C. any ∫ ( jω ) 2 Department of EECS University of California, Berkeley EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith Phasor notation z z z z z z As you may have noticed, we are going to write expressions of this form a lot, so it is very common to take the following shortcuts in notation: Take the constants to include the phase, (they will become complex constants) Since all expressions will include the complex constants, stop writing C. C. everywhere. Since e-jωt appears everywhere, (or its C. C. in the C. C. terms) stop writing it as well Don’t write the ½ either All of these, together, are called Phasor notation Department of EECS University of California, Berkeley 4 EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith Phasors z Each of the voltages between nodes, and each of the currents, can then be represented by a single complex number (remember, this is for a single frequency input of a particular phase and amplitude) 1 { vany (t ) = [Vany e j (φ ) ]e j (ωt ) + C.C ⇒ Vˆany 2 Vˆany { 1 iany (t ) = [ I any e j (φ ) ]e j (ωt ) + C.C ⇒ Iˆany 2 Iˆany Department of EECS University of California, Berkeley EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith Tricky Bits: z z z z Phasor notation is very convenient, but there are some tricky parts to look out for: You can not use phasor notation (without added precautions) if you need to multiply voltages and currents (such as in a power calculation), because that is not linear! Another way to look at phasor notation is that instead of adding the CC ( and dividing by 2), you take the real part, which gives the same result. However, you must not take the real part (or add the complex conjugate) before you put back in the time dependence e-jωt Department of EECS University of California, Berkeley 5 EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith Solving Linear Systems using Phasors z Any linear circuit becomes a linear equation: → L1{vany (t )} = L 2 {vin (t )}& L1,2{} have the form L{v(t )} = av(t ) + b1 z d d2 v(t ) + b2 2 v(t ) + L + c1 ∫ v(t )dt + c2 ∫∫ v(t )dt + L dt dt For our complex exponential input Vejωt this is: d jωt d 2 jωt L(Ve ) = aVe + b1V e + b2V 2 e + L + c1V ∫ e jωt + c2V ∫∫ e jωt + L dt dt Ve jωt Ve jωt = aVe jωt + b1 jωVe jωt + b2 ( jω ) 2 Ve jωt + L + c1 + c2 +L ( jω ) 2 jω ⎛ ⎞ c c = H1Ve jωt = Ve jωt ⎜⎜ a + b1 jω + b2 ( jω ) 2 + L + 1 + 2 2 + L⎟⎟ jω ( jω ) ⎝ ⎠ jωt z jωt Where H is just some complex number (at ω) Department of EECS EECS 105 Fall 2003, Lecture 3 z University of California, Berkeley Prof. J. S. Smith Notice that linear operators acting on all of the other voltages or currents are also a complex exp times a complex number: L2 {vany (t )} ⇒ ⎞ ⎛ c c H 2Vany e jωt = Vany e jωt ⎜⎜ a + b1 jω + b2 ( jω ) 2 + L + 1 + 2 2 + L⎟⎟ j ω ( jω ) ⎠ ⎝ So we are now prepared to calculate our circuits response at any frequency using algebra, instead of differential equations! Department of EECS University of California, Berkeley 6 EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith Complex Transfer Function z z z Excite a system with an input voltage vin Define the output voltage vany to be any node voltage (branch current) For a complex exponential input, the “transfer function” from input to output( or any voltage or current) can then be written: H (ω ) = n1 + n2 jω + n3 ( jω ) 2 + L d1 + d 2 jω + d 3 ( jω ) 2 + L ( just multiply top and bottom by ejωt sufficient times) Department of EECS University of California, Berkeley EECS 105 Fall 2003, Lecture 3 z Prof. J. S. Smith The amplitude of the output is the magnitude of the complex number and the phase of the output is the phase of the complex number: ⎛ ⎞ c c y = Hx = e jωt ⎜⎜ a + b1 jω + b2 ( jω ) 2 + L + 1 + 2 2 + L⎟⎟ jω ( j ω ) ⎝ ⎠ jωt j p H (ω ) y = e H (ω ) e Re[ y ] = H (ω ) cos(ωt + p H (ω )) Department of EECS University of California, Berkeley 7 EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith Impedance z Suppose that the “input” is defined as the voltage of a terminal pair (port) and the “output” is defined as the current into the port: + v(t ) Arbitrary LTI Circuit i (t ) v(t ) = Ve jωt = V e j (ωt +φv ) i (t ) = Ie jωt = I e j (ωt +φi ) – z The impedance Z is defined as the ratio of the phasor voltage to phasor current (“self” transfer function) Z (ω ) = H (ω ) = V V j (φv −φi ) = e I I Department of EECS University of California, Berkeley EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith Admitance z Suppose that the “input” is defined as the current of a terminal pair (port) and the “output” is defined as the voltage into the port: + v(t ) Arbitrary LTI Circuit i (t ) v(t ) = Ve jωt = V e j (ωt +φv ) i (t ) = Ie jωt = I e j (ωt +φi ) – z The admittance Z is defined as the ratio of the phasor current to phasor voltage (“self” transfer function) Y (ω ) = H (ω ) = Department of EECS I I = e j (φi −φv ) V V University of California, Berkeley 8 EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith Voltage and Current Gain z The voltage (current) gain is just the voltage (current) transfer function from one port to another port: + + v1 (t ) Arbitrary LTI Circuit i1 (t ) – z z i2 (t ) v2 (t ) – Gv (ω ) = V2 V2 j (φ2 −φ1 ) = e V1 V1 Gi (ω ) = I 2 I 2 j (φ2 −φ1 ) = e I1 I1 If G > 1, the circuit has voltage (current) gain If G < 1, the circuit has loss or attenuation Department of EECS University of California, Berkeley EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith Transimpedance/admittance z z Current/voltage gain are unitless quantities Sometimes we are interested in the transfer of voltage to current or vice versa + + Arbitrary linear Circuit v1 (t ) or i1 (t ) – Department of EECS i2 (t ) or v2 (t ) – J (ω ) = V2 V2 j (φ2 −φ1 ) = e I1 I1 [Ω] K (ω ) = I 2 I 2 j (φ2 −φ1 ) = e V1 V1 [S ] University of California, Berkeley 9 EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith Direct Calculation of H (no DEs) z z z To directly calculate the transfer function (impedance, transimpedance, etc) we can generalize the circuit analysis concept from the “real” domain to the “phasor” domain With the concept of impedance (admittance), we can now directly analyze a circuit without explicitly writing down any differential equations Use KVL, KCL, mesh analysis, loop analysis, or node analysis where inductors and capacitors are treated as complex resistors Department of EECS University of California, Berkeley EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith LPF Example: Again! z z Instead of setting up the DE in the time-domain, let’s do it directly in the frequency domain Treat the capacitor as an imaginary “resistance” or impedance: → time domain “real” circuit z frequency domain “phasor” circuit Last lecture we calculated the impedance: ZR = R Department of EECS ZC = 1 j ωC University of California, Berkeley 10 EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith LPF … Voltage Divider z Fast way to solve problem is to say that the LPF is a voltage divider, using phasors: 1 V ZC 1 j ωC H (ω ) = o = = = Vs Z C + Z R R + 1 1 + jωRC j ωC Department of EECS 9 University of California, Berkeley EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith Bigger Example (no problem!) z Consider a more complicated example: Z eff H (ω ) = Vo ZC 2 = Vs Z eff + Z C 2 H (ω ) = Department of EECS Z eff = R2 + R1 || Z C1 ZC 2 R2 + R1 || Z C1 + Z C 2 University of California, Berkeley 11 EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith Building Tents: Poles and Zeros z For most circuits that we’ll deal with, the transfer function can be shown to be a rational function H (ω ) = z The behavior of the circuit can be extracted by finding the roots of the numerator and denominator H (ω ) = z n1 + n2 jω + n3 ( jω ) 2 + L d1 + d 2 jω + d 3 ( jω ) 2 + L ( z1 − jω )( z 2 − jω ) L ∏ ( zi − jω ) = ( p1 − jω )( p2 − jω ) L ∏ ( pi − jω ) Or another form (DC gain explicit) H (ω ) = G0 ( jω ) K (1 − jωτ z1 )(1 − jωτ z 2 ) L = G0 ( jω ) K (1 − jωτ p 2 )(1 − jωτ p 2 ) L ∏ (1 − jωτ ∏ (1 − jωτ Department of EECS z ,i ) p ,i ) University of California, Berkeley EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith Poles and Zeros (cont) z z “poles” The roots of the numerator are called the “zeros” since at these frequencies, the transfer function is zero The roots of the denominator are called the “poles”, since at these frequencies the transfer function peaks (like a pole in a tent) Department of EECS H (ω ) = ( z1 − jω )( z 2 − jω ) L ( p1 − jω )( p2 − jω ) L University of California, Berkeley 12 EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith Finding the Magnitude (quickly) z The magnitude of the response can be calculated quickly by using the property of the mag operator: H (ω ) = G0 ( jω ) K = G0 ω K z (1 − jωτ z1 )(1 − jωτ z 2 ) L (1 − jωτ p 2 )(1 − jωτ p 2 ) L 1 − jωτ z1 1 − jωτ z 2 L 1 − jωτ p 2 1 − jωτ p 2 L The magnitude at DC depends on G0 and the number of poles/zeros at DC. If K > 0, gain is zero. If K < 0, DC gain is infinite. Otherwise if K=0, then gain is simply G0 Department of EECS University of California, Berkeley EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith Finding the Phase (quickly) z As proved in HW #1, the phase can be computed quickly with the following formula: (1 − jωτ z1 )(1 − jωτ z 2 ) L p H (ω ) =p G0 ( jω ) K (1 − jωτ p 2 )(1 − jωτ p 2 ) L =p G0 + p ( jω ) K + p (1 − jωτ z1 )+ p (1 − jωτ z 2 ) + L − p (1 − jωτ p1 )− p (1 − jωτ p 2 ) − L z Now the second term is simple to calculate for positive frequencies: p ( jω ) K = K z π 2 Interpret this as saying that multiplication by j is equivalent to rotation by 90 degrees Department of EECS University of California, Berkeley 13 EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith Bode Plots z z z Simply the log-log plot of the magnitude and phase response of a circuit (impedance, transimpedance, gain, …) Gives insight into the behavior of a circuit as a function of frequency The “log” expands the scale so that breakpoints in the transfer function are clearly delineated Department of EECS University of California, Berkeley EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith Log ratios and definition of dB z z z The frequency response can vary by orders of magnitude rapidly We can expand range by taking the log of the magnitude response dB = deciBel (deci = 10) 0 -10 -20 ⎛ V0 ⎞ ⎛V ⎞ ⎜⎜ ⎟⎟ = 20 log⎜⎜ 0 ⎟⎟ ⎝ Vs ⎠ dB ⎝ Vs ⎠ -30 -40 0.1 Department of EECS 1 10 100 University of California, Berkeley 14 EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith Why 20? Power! z z Why multiply log by “20” rather than “10”? Power is proportional to voltage squared to make ratios in power and voltage come out the same, for power ratios use 10×, for voltage ratios, use 20× 2 ⎛V ⎞ ⎛V ⎞ dB = 10 log⎜⎜ 0 ⎟⎟ = 20 log⎜⎜ 0 ⎟⎟ ⎝ Vs ⎠ ⎝ Vs ⎠ Department of EECS University of California, Berkeley EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith Example: High-Pass Filter z L jω j ωL R H (ω ) = = R + j ωL 1 + j ω L R jωτ H (ω ) = 1 + jωτ Using the voltage divider rule: ω →∞⇒ H → ω →0⇒ H → ω= Department of EECS 1 τ ⇒ jωτ =1 jωτ 0 =0 1+ 0 j 1 H = = 1+ j 2 University of California, Berkeley 15 EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith HPF Magnitude Bode Plot z Recall that log of product is the sum of log H (ω ) dB = jωτ dB ωτ = 1 ⇒ jωτ dB jωτ 1 + jωτ = jωτ dB + dB 1 1 + jωτ dB Increase by 20 dB/decade = 0 dB Equals unity at breakpoint 40 dB 20 dB 20 dB 0 dB 0.1 1 Department of EECS 10 100 -20 dB University of California, Berkeley EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith HPF Bode dissection z The second term can be further dissected: 1 1 + jωτ 0 dB .1 / τ -20 dB 1/τ = 0 dB − 1 + jωτ dB dB ω << 10 / τ 20 dB ω >> -40 dB ω= -60 dB ω= Department of EECS 1 τ 1 τ 1 τ 1 τ 0 dB -20 dB/dec ~ -3dB - 3dB University of California, Berkeley 16 EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith slope z At breakpoint: ⎛V ⎞ ω = 1 / τ → ⎜⎜ 0 ⎟⎟ = −3 dB V ⎝ z s ⎠ dB Observe: slope of signal attenuation is 20 dB/decade in frequency ⎛V ⎞ ω = 100 / τ → ⎜⎜ 0 ⎟⎟ = −40 dB ⎝ Vs ⎠ dB ⎛V ⎞ ω = 1000 / τ → ⎜⎜ 0 ⎟⎟ = −60 dB ⎝ Vs ⎠ dB Department of EECS University of California, Berkeley EECS 105 Fall 2003, Lecture 3 Prof. J. S. Smith Composite Plot z Composite is simply the sum of each component: jωτ + dB 1 1 + jωτ jωτ dB 0 dB .1 / τ 1/τ dB High frequency ~ 0 dB Gain 10 / τ Low frequency attenuation -20 dB 1 1 + jωτ dB -40 dB Department of EECS University of California, Berkeley 17