Definitions and Symbols I VI = VIej I = VI VI (t ) VI cos(2f I t I ) ; VI is the amplitude of the input sinusoidal signal; I is the phase of the input sinusoidal signal. VO = VOej O = VO O is the vector quantity corresponding to the output sinusoidal waveform is the vector quantity corresponding to an input sinusoidal waveform VO(t ) VO cos(2f O t O ) ; VO is the amplitude of the output sinusoidal signal; O is the phase of the output sinusoidal signal. G(jw) is the transfer function of the filter, which depends on the input sinusoidal frequency fI=wI/2. w is the angular frequency of the input sinusoidal signal. G(jw) amplitude is |G(jw)| while its phase is G(jw): G(jw)= |G(jw)| G(jw) =RC is the time constant of the first order RC filter fC is the cutoff frequency of the filter, which defines the pass band B of the filter. B is the pass band of the filter and it is the range of frequencies for which the input sinusoidal signal is not significantly attenuated. Bw is the bandwidth of the filter and it is the width of its pass band B. A Decade is the distance between two major ticks in a frequency logarithmic scale axis. Decibel (dB) is a measurement unit defined as 20*Log of the value of the quantity to be measured. Log is the logarithmic with base 10. The Bode plot is the transfer function amplitude diagram in full logarithmic scale: both |G| (transfer function amplitude) axis and f (frequency) axis are represented in logarithmic scale. OPAMP stands for OPerational AMPlifier, and it is an integrated circuit (IC) used to realize active filters. 1 1 2 3 4 5 6 7 8 9 10 11 12 Lesson 1: RC low pass filter schematic and transfer function (2hrs) Objectives To know the schematic of an RC low-pass filter. To calculate the transfer function of an RC low-pass filter. To calculate the time constant of an RC low-pass filter. To draw the schematic of a circuit with CAD tools in English. Today we're going to study a new circuit: the RC low-pass filter in the frequency domain. We‟ll start with the schematic of the filter, shown in figure 1.1. R VI(jw) stimulus or input sinusoidal voltage 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 C VO(jw) output sinusoidal voltage Fig. 1.1: schematic of a first-order passive RC low pass filter. We are going to study the frequency response of this simple circuit. Since we are interested in the frequency response the input voltage VI is a sinusoidal waveform with amplitude VI, frequency fI and phase I: VI VI cos(2f I t I ) . The output voltage VO is sinusoidal too with frequency fI because there are only linear components in the circuit (a resistor R and a capacitor C) that cannot cause distortion. So VO is a sinusoidal waveform with amplitude VO, phase O and the same frequency fI as VI: VO VO cos(2f I t O ) . We can represent both VI(t) and VO(t) with the corresponding vector quantities: VI=VIejI and VI=VOejO. Assuming the input signal VI is known (the circuit stimulus) the only unknown variables of the output signal VO are its amplitude VO and its phase O. How can we find the mathematical relation between VO and VI and O and I? The RC filter can be seen as an impedance divider, as shown in figure 1.2: the input signal VI is divided between the resistor impedance (Z1=R) and the capacitor impedance (Z2=1/jwC). 2 Z1=R VI(jw) Z2=1/jwC 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 VO(jw) Fig. 1.2: the schematic of a first-order passive RC low pass filter can be seen as an impedance divider. Thus, applying the simple impedance divider formula we get: Z2 1 1 VI , where Z 2 Eq. 1.1) VO is the capacitor impedance. As it can j w C j 2 f C R Z2 be seen, Z2 depends on w=2f, the frequency of the input signal. The transfer function G(jw) of the RC filter is defined as: VO Eq. 1.2) G ( jw) . VI Note that by definition VO( jw) G( jw) VI ( jw) . We can therefore determine the amplitude and phase of VO(jw) using the properties of complex numbers: Eq. 1.3.a) Amplitude of VO(jw): VO G( jw) VI (the amplitude of the output is the product of the amplitude of the input and the amplitude of the transfer function at the stimulus given frequency). Eq. 1.3.b) Phase of VO(jw): O arg[ G( jw)] I , where arg[G(jw)]=G(jw), is the phase of the transfer function (the phase of the output is the sum of the phase of the input and the phase of the transfer function at the stimulus given frequency). Using equations 1.3 a) and b) we can calculate VO and O once VI, I and G(jw) are known. Note that VI, I are the given inputs, so the only unknown variable of our problem is G(jw). However, using equations 1.1 and 1.2 G(jw) is given by: Z2 VO Eq. 1.4) G( jw) VI R Z2 By substituting Z2=1/jwC into equation 1.4 we get: 1 1 1 1 jwC G ( jw) ; =RC is defined as the time constant of the RC 1 1 jwC jwRC 1 R R jwC jwC filter; hence we can write the transfer function of the low-pass RC filter as: 1 1 Eq. 1.5) G( jw) 1 jw 1 j 2 f 3 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 Equation 1.5 shows that G(jw) is a complex number whose value depends only on the filter time constant and the frequency f of the input signal. From equation 1.5, using the properties of complex numbers, we can easily calculate the amplitude G( jw) and the phase G(jw)= arg[G(jw)] of the filter transfer function: 1 Eq. 1.6.a) G ( jw) , 1 (w ) 2 Eq. 1.6.b) G ( jw) artg ( w ) By substituting equation 1.6.a into 1.3.a and equation 1.6.b into 1.3.b we reach our final resolution formulas: VI 1 Eq. 1.7.a) VO VI 1 (w ) 2 1 (w ) 2 Eq. 1.7.b) O artg (w ) I I artg (w ) VI, I and w=2f are the amplitude, phase and angular frequency of the input signal and are all known quantities. =RC depends on the RC filter components and can be calculated from the filter schematic. Hence, eq. 1.7.a and 1.7.b are the resolution formulas that allow us to calculate amplitude and phase of the output for any given input and any given RC filter. For instance, let‟s consider an RC low pass filter with R=1K and C=159.24nF. We can easily determine its constant time 1 159.24 103 10 9 s 159.24 10 6 s 0.15924 10 3 s , i.e. about 0,16ms. Now let‟s consider two different cases: Case A) input signal VI with amplitude 1V, phase 0 degrees (00) and frequency 1KHz; Case B) input signal VI with amplitude 1V, phase 0 degrees (00) and frequency 15KHz. In case A the input frequency is 1KHz, hence the value of the amplitude of the transfer function is (see eq. 1.6.a): 1 1 1 1 1 G( jw) 0,707 2 1 (w ) 2 1 (2 1KHz 0,16ms) 2 1 (2 0,16) 2 1 (1,005) 2 23 24 25 Therefore, the amplitude of the output voltage is VO 0.707 VI 0.707 1.5V 1.06V . The phase of the transfer function at 1KHz is instead (see eq. 1.6.b): G ( jw) artg (w ) artg (2 1KHz 0.16ms) artg (1.005) 450 . 26 27 28 Therefore, the phase of the output voltage is O 0 0 450 450 . Considering now case B the input frequency is 15KHz, so the values of the amplitude and of the phase of the transfer function are: 1 1 G( jw) 0.066 1 (2 15KHz 0.16ms) 2 1 (15.08) 2 29 30 G ( jw) artg (w ) artg (15,08) 86.2 0 . 31 Consequently the amplitude of the output voltage is VO 0.066 VI 0.066 1.5V 1V , while the 32 33 34 35 36 37 38 phase of the output voltage is O 0 0 86.2 0 86.2 0 . Of course different results are obtained if we change input frequency (w value changes) and/or the resistor or the capacitor of the RC filter ( value changes). English is an important language for electronics since modern electronics was born in the United States with the invention of the transistor in 1958. English is the common language of the electronic engineers community and all electronics components are described by datasheets written in English. Commonly 4 1 2 3 4 5 6 used CAD (Computer Aided Design) tools, useful to design electronic circuits, are in English language, too. Hence, the knowledge of technical English is a necessary prerequisite to design any innovative electronic circuit. Just to supply an example we will now use a CAD tool called LTSpiceIV that can be downloaded freely from the Internet (http://www.linear.com/designtools/software) to build the schematic of the RC low-pass filter we have just analyzed. 7 5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 Lesson 2: Frequency response graphical representation. (2 hrs) Objectives To be able to use the frequency response graphs of a filter to calculate the output voltage. To know the cutoff frequency (fC) and the low-pass filter pass-band (B) and the relationship between fC and . To be able to recognize and draw the graphs of the frequency response of a low-pass filter in logarithmic scale. To be able to design a first-order RC low-pass filter with a given pass-band B. To draw logarithmic and semilogarithmic graphs of the frequency response of an RC low-pass filter with MS-excel. In the previous lesson we found the algebraic expressions of the amplitude and phase of the transfer function G(jw) of a first order RC low-pass filter: 1 Eq. 2.1) G ( jw) , G ( jw) artg ( w ) 2 1 (w ) w Both functions depend on the frequency f of the input signal VI. We also showed how to 2 calculate VO using Eq. 2.1). In this lesson we will show a more straightforward approach for the calculation of VO, i.e. the graphical approach. By definition of transfer function it is: Eq. 2.2) VO G( jw) VI , O I G ( jw) The graphical approach uses Eq. 2.2) but does not calculate |G(jw)|and G(jw) analytically. On the other hand, the amplitude and phase of the transfer function at the given input frequency are directly read from the amplitude and phase diagrams of the filter. The amplitude diagram shows |G(jw)| vs. f while the phase diagram shows G(jw) vs. f. An example of amplitude and phase plots for an RC low pass filter with =1ms is given in figure 2.1. Hence, once we know the amplitude and phase plots of a given filter it is very easy to determine the value of |G(jw)| and G(jw) graphically from the plot at the given input frequency without any analytical calculation (without calculating Eq. 2.1). For instance, let us assume the input is a sinusoidal waveform with the following characteristics: V I =1.5V, I=00 and f=100Hz. From the amplitude plot at f=100Hz we read |G|=0.8 while from the phase plot at 100Hz we read G=350. Hence, using Eq. 2.2 we derive that VO=0.8*1.5V=1.2V while O=00-350=-350. Let‟s assume now that the same input sinusoidal waveform has a higher frequency, 1KHz instead of 100Hz. At 1KHz we read |G|=0.18 and G=-810 from the amplitude and phase plots, respectively. Hence at 1KHz the output of the filter is given by VO=0.18*1.5V=0.27V while O=00-810=-810. The examples above show two clear advantages of the graphical method: 1) it is valid for any filter topology: we need only to know the amplitude and phase plots associated to the filter to determine its output voltage. 2) output voltage is very easily calculated for any input frequency since we need only to solve Eq. 2.2 where |G| and G are directly read from the filter plots. 6 Phase diagram 0 -15 0.8 -30 G(jw) -350 -45 -60 0.18 -810 -75 -90 1000000 100000 frequency 10000 1000 100 10 1 0,1 1000000 100000 10000 1000 100 10 1 frequency Fig. 2.1: examples of amplitude and phase plots for a first order RC low-pass filter with =1ms. Let‟s now analyze more in detail the filter amplitude diagram (|G| vs. f), shown in figure 2.2: |G(jw)| |G(jw)| Amplitude diagram 1 0,9 0,8 0,7 0,6 0,5 0,4 0,3 0,2 0,1 0 0,1 Amplitude diagram 1 0,9 0,8 0,7 0,6 0,5 0,4 0,3 0,2 0,1 0 |G|=0,7 B=[0,fC] 1Decade fC=160Hz 1000000 100000 10000 frequency 1000 100 10 1 0,1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 Note the frequency scale is logarithmic Fig. 2.2: example of amplitude diagram of a passive first order RC filter. Note the cutoff frequency fC can be easily read and that the frequency scale of the diagram is logarithmic. Note also the pass band (B) of the filter. The cutoff frequency fC of the filter is defined as the frequency value at which |G|=0.7. So when input signal frequency f is less than the cutoff frequency (f<fC) the output signal amplitude is equal or only slightly lower than input amplitude (no attenuation or only small attenuation of the input). On the contrary, when f>fC the output signal amplitude is significantly lower than input amplitude (significant attenuation). To sum up we can roughly approximate an ideal low-pass filter behavior as follows: - input with f<fC no attenuation (the input signal passes) VO=VI - input with f>fC great attenuation (the input signal is cut) VO0 In fact, a low pass filter is typically used to eliminate (attenuate) all high frequency components of the input signals. Its fC represents the frequency threshold at which the filter starts to be active. The pass band B of the filter is the range of frequencies for which |G| 0.7, i.e. the input signal is not significantly attenuated (the input signal “passes”). Of course, it is B= [0,fC] for the low pass RC filter. The bandwidth Bw of the filter is the width of the pass band B, hence: Bw=fC-0=fC. The following relationship between fC and can be easily demonstrated (do it yourself to exercise!): Eq. 2.3) fC 1 2 1 2 R C 7 1 2 3 4 5 6 7 8 9 Finally, note the frequency scale of the plot is logarithmic and not linear. In fact, the distance between 0.1 and 1Hz is the same between 100 and 1000Hz. The frequency logarithmic scale allows to read the values of the whole amplitude waveform for a wide range of frequencies. The distance between f and 10*f in the logarithimic scale is called a Decade. So, when we move from 1Hz to 10Hz we increase the frequency of a Decade. When we move from 1Hz to 100Hz we increase the frequency of 2 Decades. Figure 2.3 shows the comparison between a linear and a logarithmic scale: the logarithmic scale is much wider than the linear one. linear scale 1Hz 1 2 1 3 4 5 6 2 3 7 8 9 10 11 12 4 5 6 7 8 10 19 20 21 22 23 24 25 26 100 1 decade 200 logarithmic scale Fig. 2.3: comparison between logarithmic and linear frequency axis scale. In the linear scale the distance between two ticks is constant =1Hz. In the logarithmic scale the distance between 10*f and f is constant = 1 Decade. Hence, the logarithmic scale features a much wider range of frequency values. Figure 2.4 shows the comparison between the same two amplitude diagrams, one with logarithmic frequency scale and the other with linear frequency scale. The frequency axis of the two plots are the same (from 0.1Hz to 1000000Hz=1MHz). Only the plot with logarithmic scale can be used to read the transfer function amplitude values at different frequencies. Amplitude diagram 1 |G(jw)| |G(jw)| 0,8 0,6 0,4 fC=160Hz 0,2 Amplitude diagram 1 log. scale 0,8 linear scale 0,6 0,4 0,2 0 0 frequency 1000000 900000 800000 700000 600000 500000 400000 300000 200000 100000 0,1 1000000 100000 10000 frequency 1000 100 10 1 0,1 19 20 21 22 23 24 25 26 27 28 29 30 31 32 17 18 20 9 10 11 12 13 14 15 16 17 18 13 14 15 16 Fig. 2.4: the same two amplitude diagrams with and without logarithmic scale are compared. The values of fC and of the transfer function amplitude can be read only from the logarithmic plot. Figure 2.5 shows the filter phase diagram (G vs. f). We can divide the plot into three different frequency ranges: - f<<fC G=00, the filter does not introduce any phase shift, i.e. the output waveform is not delayed with respect to the input. - f=fC G=-450, at the cutoff frequency the filter phase shift is -450, corresponding to a delay=0.125/fC of the output waveform with respect to the input. - f>>fC G=-900, the filter introduces the maximum phase shift. The output waveform exhibits the maximum delay with respect to the input =0.25/f. Finally, we can roughly approximate an ideal low-pass filter behavior as follows: - input with f<fC no delay (the input signal passes without any delay) O=I 8 1 2 - input with f>fC 900 delay (the input signal is delayed) O=I-90° fC=160Hz Phase diagram 0 -15 -30 G(jw) frequency scale is logarithmic -45 -60 -75 -90 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1E+06 12 1E+05 11 10000 10 1000 100 10 1 0,1 frequency 3 4 5 6 7 8 9 Fig. 2.5: example of phase diagram of a passive first order RC filter. The cutoff frequency fC is the frequency value at which G=-450. The frequency scale is logarithmic. Let‟s now rewrite Eq. 2.2 for the calculation of the output voltage of a filter: Eq. 2.4) VO G( jw) VI . The equation becomes dimensionless if we divide both its members by 1V: V V Eq. 2.5) O G ( jw) I . 1V 1V We can rewrite equation 2.5 in decibel (dB) by applying the function 20*Log() to both its members: V V Eq. 2.6) 20 Log ( O ) 20 Log ( G( jw) I ) . 1V 1V Remembering the properties of the logarithm Log(a*b)=Log(a)+Log(b) we can rewrite equation 2.6 as follows: V V Eq. 2.7) 20 Log ( O ) 20 Log ( G( jw) ) 20 Log ( I ) . 1V 1V V Since by definition of dB it is: 20 Log ( O ) VO [dBV], 20 Log ( G( jw) ) | G( jw) | [dB] and 1V V 20 Log ( I ) VI [dBV], equation 2.7 gives the resolution formula to calculate the filter output in dB: 1V Eq. 2.8) VO [dBV ] G( jw) [dB] VI [dBV ] . The filter output voltage amplitude (VO) in dBV is equal to the filter input voltage amplitude (VI) in dBV plus the value in dB of the filter transfer function amplitude (|G|) in dB calculated at the given input frequency f=w/2. Eq. 2.8 is almost the same of Eq. 2.2: the only difference is that the product in Eq. 2.2 becomes a sum in Eq. 2.8. Since the addition is a mathematical operation much simpler than the multiplication, engineers prefer to use Eq. 2.8 rather than Eq. 2.2. This means that engineers prefer to plot |G(jw)| in dB vs. frequency. When |G| is expressed in dB the transfer function amplitude plot of figure 2.2 becomes as shown in figure 2.6: 9 Amplitude diagram in dB (Bode Plot) |G(jw)| [dB] 0 -10 -20 -30 -3dB -40 -50 -60 20dB fC=160Hz 1dec -70 -80 1000000 100000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 10000 1000 100 10 1 0,1 frequency Fig. 2.6: this is the same amplitude diagram of figure 2.2 with the only difference that the amplitude |G| is expressed in dB. This is a full logarithmic plot and it is called Bode plot of the filter. The transfer function amplitude (|G|) plot in dB is called the Bode plot of the filter (any system described by a transfer function has its own Bode plot). The Bode plot is a full logarithmic scale plot, since the scale in dB=20*Log() is logarithmic too. The cutoff frequency fC in a Bode plot is the frequency at which |G|[dB]=-3dB. In fact, when f=fC |G|=0.7 and hence |G|[dB]=20*Log(0.7)=-3 decibel. When f>fC the Bode plot can be approximated with a straight line of slope -20dB/decade. In fact, |G(jw)|[dB] decreases of 20dB for each increase of a factor of 10 of the frequency, i.e. for each decade of increase of frequency. Thanks to this property the Bode plot graphical drawing is very simple since it can be approximated with only two straight lines: 1) f<fC |G(jw)|=0 (horizontal line along x-axis) 2) f<fC |G(jw)|=-20*Log(f/fC) (straight line with slope -20dB/dec). Once the filter is given, fC can be calculated using Eq. 2.3. When fC is known the drawing of the Bode plot of the filter is straightforward, as shown in figure 2.7: |G(jw)| [dB] 0dB fC 10fC 100fC 1000fC f (log) -20dB -40dB -60dB 18 19 20 21 Fig. 2.7: example of simplified Bode plot drawing of a first order RC low pass filter. The only significant approximation of this plot is that |G(fC)|=0dB while it is -3dB in reality. 10 1 2 3 4 5 6 7 8 9 In a few words, the Bode plot of the filter presents the following advantages with respect to the traditional plot with a linear scale along |G| axis: 1) very simple to draw using the -20dB/dec rule. 2) VO can be calculated as a sum of VI and the |G| value read from the plot. For instance, let‟s consider an input signal of amplitude =0dBV (corresponding to 1V amplitude) at the frequency f=10000Hz=10KHz. From the Bode plot of Fig. 2.5 we read that |G|=-35dB when f=10KHz. Hence, we can immediately calculate VO=0dBV-35dB=-35dBV using equation 2.8). Engineers of some years ago were familiar with voltage values in dB. For us it is a little more difficult to associate a voltage value to -35dBV. In this case it is sufficient to remember the inverse formula: 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 Eq. 2.9) VO [V ] 10 20 , from which VO=10-1.75V=0.018V (remember these general rules: 0dBV corresponds to 1V. when dBV values are negative it means voltage amplitude is between 1 and 0. The positive dB values are for all voltages >1V). VO [ dBV ] Eq. 2.3) is used to calculate fC when the filter is known. However, it is often required to design a filter for a given fC or pass band B. First of all we can use the inverse formula of Eq. 2.3) to calculate the time constant of the filter: Eq. 2.10) 1 1 . 2 fC 2 B Then we can design the filter following the four steps algorithm proposed below: 1) calculate using equation 2.10) 2) choose a capacitor among those available in the laboratory, for instance C=1F 3) calculate the corresponding value of R according to the formula: R C 4) if R is within the range [100,100K] OK, otherwise go back to point 2) choosing another C value It is suggested to choose the capacitor value among those available because almost all resistors values are commonly available. It is recommended not to have R<100 because parasitic resistors may affect filter parameters. R>100K is not recommended either because the filter impedance may become comparable to that of multimeters, thus affecting filter behavior by multimeter insertion. For instance, the desing of a filter with fC =1KHz can be done as follows: 1 1.59 10 4 s 1.59 10 4 s ; 2) C=1F; 3) R 159 ; 4) R[100,100K]OK! 2 fC 10 6 F And now we‟ll conclude the lesson by showing how to use an electronic sheet as MS-excel to draw amplitude and phase plots of first order low pass RC filters. The starting point is equation 2.1) with the analytical expression of |G| and G. MS-excel is used to calculate those analytical expressions at the various frequency values of interest and to plot the corresponding graphs. 1) 11 1 2 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Lesson 3: Analysis of the CR high pass filter. (2 hrs) Objectives To be able to draw the schematic of a high-pass CR filter and to know its transfer function. To be able to draw amplitude and phase diagrams of the high-pass filter. To know the relationship among the time constant (), the cutoff frequency (fC) and the filter pass band (B). To be able to calculate the output voltage with the graphical method. To be able to design the filter with a given cutoff frequency fC. To be able to simulate the filters with CAD tools in English. In the previous lesson we saw how to represent the transfer function of a low pass RC filter graphically. Figure 3.1 shows the schematic of a first-order passive CR high pass filter: C O 1µ R VI(jw) (0 1 1K) 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 159 VI=VIeji VO(jw) VO=VOejo Fig. 3.1: schematic of a first order passive CR high pass filter. The schematic is very similar to that of a low pass filter (compare figure 3.1 with figure 1.1 of lesson 1). The only difference is that R and C are interchanged. So we can follow the same approach used for the RC low pass filter to determine the high pass filter transfer function: V ( jw) Z2 Eq. 3.1) | G( jw) | O , VI ( jw) Z1 Z 2 where the only difference with respect to the low pass filter is that: Z1=1/jwC while Z2=R (Z1 and Z2 are interchanged). Substituting Z1 and Z2 expression into equation 3.1 after a few mathematical passages we get the analytical expression of the high pass filter transfer function G(jw): j w G ( jw) Eq. 3.2) 1 j w is the time constant of the filter and it is defined as in the low pass filter: =RC. Using the properties of complex numbers, we can calculate the amplitude and phase of G(jw) from equation 3.2: w G ( jw) 900 .artg (w ) Eq. 3.3) G ( jw) , 2 1 ( w ) 13 Equation 3.3 can be used to calculate the output of the filter once the input is known. However, equation 3.3 can also be used to represent the frequency response diagrams of the filter graphically by means of MS-excel, as shown in the previous lesson. Figure 3.2 shows the amplitude and phase diagrams of a CR high pass filter with =0.16ms obtained using equation 3.3 and MS-excel: Amplitude diagram in dB (Bode Plot) |G(jw)| [dB] 0 -10 -20 -30 -40 -50 -60 G(fc)=+450 45 30 fC=1KHz 15 0 1000000 100000 10000 frequency 1000 100 10 1 0,1 1000000 100000 28 29 30 31 32 33 34 35 36 37 10000 27 1000 100 10 1 0,1 frequency 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 60 fC=1KHz 1dec -70 -80 75 B=[fC,] 20dB Phase diagram 90 |G(fC)| = -3dB G(jw) 1 2 3 4 Fig. 3.2: amplitude and phase diagrams of a CR high pass filter with =0.16ms. The filter cutoff frequency fC is defined as the frequency at which |G|=-3dB (corresponding to a 0.7 factor of amplitude attenuation), as for the low pass filter. However note that for the high pass filter when f= fC it is G=450 and not -450 as for the low pass filter. This means that the high pass filter output is phase led with respect to the input, and not delayed as occurs in the low pass filter case. The high pass filter pass band B is defined as the frequency range for which |G|>-3dB (or 0.7), i.e. the frequency range where filter amplitude attenuation can be considered negligible. This is exactly the same definition used in the low pass filter case. However, B=[fC,] for the high pass filter, as it can be seen from figure 3.2. Consequently, the bandwidth Bw (i.e. the width of B) of the filter =. Another important property of the Bode plot of the high pass filter is that |G| increases of 20dB for each decade of increase of frequency (i.e. for a factor 10 of frequency increase). With regard to the phase plot, the maximum phase shift of +900 occurs when f<<fC and corresponds to an output voltage with 0.25/f lead with respect to input voltage. On the contrary when f>>fC there is no phase delay. In conclusion, input „high‟ frequencies (where „high‟ means higher than filter fC) are not significantly attenuated nor phase shifted – the output and the input of the filter are practically the same. On the contrary, input „low‟ frequencies (lower than fC) are attenuated and phase led, so that the output amplitude is negligible and it is phase led with respect to the input. In a high pass filter, input high frequencies “pass”, input low frequencies are “cut”. The relationship between and fC is the same as the low pass filter: 1 1 1 fC Eq. 3.4) , 2 2 R C 2 fC Hence, the design of the high pass filter can be done exactly the same way as that of a high pass filter (the four step algorithm): 1) calculate corresponding to the required fC using equation 3.4) 2) choose a capacitor among those available in the laboratory, for instance C=1F 3) calculate the corresponding value of R according to the formula: R 14 C 1 2 3 4 5 6 4) if R[100,100K] OK, otherwise go back to point 2) choosing another C value The Bode plot of the filter is easy to draw, too. In fact, we can approximate it as two straight lines: 1) one horizontal line when f>fC: |G(f)|=0dB (=1) when f>fC 2) one straight line with slope 20dB/dec when f< fC: |G(f)|=20*Log(f/ fC) Figure 3.3 shows the Bode plot of a generic high pass filter obtained following the two rules above: |G(jw)| [dB] 0,01fC 0,1fC fC 0dB -20dB f (log) -40dB 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 -60dB 0,001fC Fig. 3.3: Bode plot drawing of a first order high pass filter. The only significant approximation is |G|=0dB when f=fC (|G(fC)|=-3dB in reality). Let‟s now show some examples of output calculation for the high pass filter of figure 3.1. We‟ll calculate the ouput using the graphical method, based on the knowledge of the two graphs of figure 3.2 and of the output resolution formulas found in lesson 2 (valid independently of filter topology and order): Eq. 3.5) VO [dBV ] G( jw) [dB] VI [dBV ] , O I G ( jw) . The input voltage amplitude is VI=1V (corresponding to 0dBV), the input phase voltage is I=00 and we will consider three different cases of input frequency: Case 1): f=100Hz. In this case we read from the graphs of figure 3.2 that |G(100Hz)|=-20dB while G(100Hz)=830. Hence, using equation 3.5 we derive: VO=-20dB+0dBV=-20dBV corresponding to 0.1V (using equation 2.9); O=830+00=830 (i.e.output with 83/(360*100Hz)=2.3ms lead). Case 2): f=1KHz. In this case we read from the graphs of figure 3.2 that |G(1KHz)|=-3dB while G(1KHz)=450. Hence, using equation 3.5 we derive: VO=-3dB+0dBV=-3dBV corresponding to 0.7V (using equation 2.9); O=450+00=450 (i.e.output with 45/(360*1KHz)=125s lead) Case 3): f=10KHz. In this case we read from the graphs of figure 3.2 that |G(10KHz)|=-0.09dB while G(10KHz)=70. Hence, using equation 3.5 we derive: VO=-0.09dB+0dBV=-0.09dBV corresponding to 0.99V (using equation 2.9); O=70+00=70 (i.e.output with 7/(360*1KHz)=1.9s lead) As expected, increasing the frequency the output amplitude increases while the phase shift decreases with respect to the input. Up to now we have shown you some useful instruments to calculate the output of an RC filter subject to a sinusoidal stimulus. In particular, we have shown the full analytical method characterized by many 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 hand calculations and the graphical method, with fewer calculations but requiring the knowledge of amplitude and phase diagrams. What is the actual method used in electronics industry? Electronic industries use a third method, really straightforward because it doesn‟t need any hand calculation at all: the simulation of electronic circuit. Circuit simulation requires only the knowledge of the circuit schematic and of the models of the components used in the circuit. Then a CAD (Computer Aided Design) tool performs all the calculations and provides the circuit output waveforms directly in a GUI (Graphical User Interface). Since the models are usually provided within the CAD tool, it may seem it doesn‟t need an electronic technician to perform these simple tasks. It may seem you only need to know the schematic and how to use the CAD tool. And in many simple cases it is really so! However, in real application a very skilled designer is required for many reasons: simulations should be run at different operating conditions (temperature, supply); parasitic effects layout dependent should be accounted for in the simulation schematic; weaknesses in the component models should be masked by robust design techniques. Simulations are widely used in electronic industry because they allow to dramatically decrease the time to market of any electronic product: circuit behavior can be predicted without any need to physically implement and measure it; modifications to circuit behavior can also be predicted without experiments; design alternatives can be evaluated without physically implementing any of them. This permits to improve the design and sell electronic products minimizing time and the number of bugs. Just as an example of simulation, we‟ll conclude this lesson by showing you how to use the CAD LTspiceIV (downloadable free from the Internet: http://www.linear.com/designtools/software/) to simulate an RC filter. Note that LtspiceIV is in English, like many other CAD tools. The Figure below shows a typical simulation output obtained with LTspiceIV. 23 16 1 2 3 4 5 6 As expected, the simulation results are in perfect agreement with the calculated ones. The RC filter is a simple circuit that can be easily solved by means of hand-calculations. However, there are electronics circuits that cannot be solved by means of hand-calculations and simulation is the only instrument to predict the behaviour of the circuit before its actual physical implementation and characterization. 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Lesson 4: An introduction to active filters and simulation examples. (2 hrs) Objectives To know the main differences between active and passive filters. To be able to draw the schematic and the frequency response of active RC low-pass and high-pass filters. To be able to draw the schematic of an RC band-pass filter and to explain how it works. To be able to simulate active filters with CAD tools. To know some practical filter applications. To know the main difference between first and second order filters. Figure 4.1 shows the schematic of a low pass filter connected to an RL load equal to 1K. R 159 O C VI(jw) K) 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1µ VI=VIeji RL 1K VO(jw) VO=VOejo Fig. 4.1: low-pass filter schematic with an RL load on the output. The RL load affects the transfer function of the filter since it is connected in parallel to the capacitor C. Hence: 1 Eq. 4.1) G ( jw) R j w RL The maximum amplitude of the output voltage is less than 1 (in fact, it is 1/(1+R/RL)) and the cutoff frequency of the filter is dependent on RL too: fC=(1+R/RL)/2. In general, the frequency response of a passive filter is dependent on the load. Furthermore, the maximum amplitude (or gain) of passive filters is 1 even when the load is a high impedance (i.e. RL=∞). Active filters provide: 1) a frequency response independent of any load. 2) a maximum amplitude that can be higher or lower than 1. Active filters are obtained by simply adding an active component (typically an OP.AMP.=OPerational AMPlifier) to a passive filter. Figure 4.2 shows the schematic of an RC low-pass active filter: 1 18 C 100n VCC R2 1.59K R1 VI VO -VSS 159 Fig. 4.2: first-order active RC low-pass filter schematic. OP05 is an OPAMP with dual supply VCC=+15V and –VSS=-15V. R1 is only used to fix the maximum amplitude value. The OPAMPVCC of figure 4.2 is connected -VSS in inverting VI input configuration. Hence G(jw)=VO/VI=-Z2/Z1, where Z2=R2//C=R2/(1+jw2) and Z1=R1. 2=R2*C is the time constant of the filter.By substituting V2 V1 V3 Z2 and Z1 into G(jw) expression we get: .tran 4m R2 1 G ( jw) .lib ./lib/sub/LTC.lib Eq. 4.2) R1 1 j w 2 15 -15 SINE(0 1 1K) G(jw) is independent of any RL load connected to VO thanks to the opamp low output resistance. Only when RL becomes comparable to opamp output resistance (RL<100) G(jw) is affected by RL. Equation 4.2 shows that maximum amplitude of the filter is R2/R1. So when R2>R1 the gain is higher than 1, while if R2<R1 maximum gain will be lower than 1. Note also the minus sign above the transfer function: this means that the output signal VO is inverted with respect to the input VI, or, equivalently, that they are phase shifted of 1800. Figure 4.3 shows the amplitude and phase diagrams of the low pass active filter designed using MSexcel, with the corresponding analytical expressions: R2 1 G( jw) [dB] 20 Log ( ) 20 Log ( ) G ( jw) 1800 artg (w ) 2 R1 1 ( w 2 ) Amplitude diagram in dB (Bode Plot) |G(jw)| [dB] 20 10 165 |G(fC)|=17dB 0 -20 G(fC)=1350 150 fC=1KHz -30 Phase diagram 180 -10 135 120 105 90 -40 1E+06 1E+05 frequency 10000 1000 100 10 1 1E+06 1E+05 frequency 10000 1000 100 10 1 19 20 21 22 23 24 OP05 G(jw) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 U1 Fig. 4.3: frequency response of the active low pass filter of figure 4.2. Note that the low frequency amplitude value of the filter is 20dB (because R2=10*R1) and fC=1KHz. Figure 4.3 shows that the amplitude diagram of the active filter is the same as the equivalent passive filter shifted up of 20dB (=20Log(R2/R1)). Also, the phase diagram is the same as the equivalent 19 passive filter shifted up of 1800 (to take into account the inversion of the output with respect to the input). The cutoff frequency fC of the filter is defined as the frequency value at which the amplitude is 3dB lower than its low frequency value, i.e. |G(fC)|=|G(0)|-3dB. Also it is: G(fC)=G(0)-450. fC can be calculated analytically by using the formula: 1 , where 2=R2*C is the time constant of the filter. 2 2 The first-order high-pass active RC filter is shown in figure 4.4: R2 1.59K Eq. 4.3) f C R1 VCC 1 2 3 4 5 6 7 8 9 C 1µ VI VO -VSS 159 10 11 12 13 14 U1 OP05 Fig. 4.4: first-order active RC high-pass filter schematic. R2 is only used to fix the maximum amplitude value. Its frequency response is shown in figure 4.5 with the analytical expressions of amplitude and phase: VCC -VSS VI 0 R2 w 1 G( jw) [dB] 20 Log ) V2 ( ) 20 Log V1 ( V3 G ( jw) 270 artg ( w 1 ) 2 R1 1 ( w 1 ) .tran 4m Amplitude diagram in dB (Bode Plot) 20 10 0 -10 -20 -30 -40 -50 -60 15 Phase diagram .lib ./lib/sub/LTC.lib SINE(0 1 1K) 255 |G(fC)|=17dB fC=1KHz 240 G(fC)=2250 225 210 195 180 1000000 100000 10000 frequency 1000 100 10 1 0,1 1000000 100000 10000 frequency 1000 100 10 1 0,1 15 16 17 18 19 20 21 22 23 24 25 26 270 -15 G(jw) |G(jw)| [dB] Fig. 4.5: frequency response of the active high pass filter of figure 4.4. Note that the high frequency amplitude value of the filter is 20dB because R2=10*R1 and fC=1KHz. fC can be determined from the plots or analytically using the expression: 1 , where 1=R1*C is the time constant of the filter. 2 1 In certain applications we‟re interested in selecting only the input frequency components included within a given frequency band B=[f1,f2]. This problem can be easily solved using the cascade of a lowpass and a high-pass filters with cutoff frequencies f2 (low pass) > f1 (high pass), as shown in figure 4.6: Eq. 4.4) f C 20 fC1 INPUT SIGNAL 1 2 3 4 5 6 7 fC2 OUTPUT SIGNAL low-pass high-pass with fC=fC1 with fC=fC2 frequencies above fC1 are attenuated frequencies above fC1 and below fC2 are attenuated Fig. 4.6: the simplest band-pass filter is the cascade of a low-pass and a high-pass active filter. Whether the low-pass comes first or second in the cascade does not matter since both filters are active. Only the fact that fC2<fC1 is important. The filter pass-band is B=[fC2,fC1]. An active band-pass filter can be designed as the cascade of the schematic 4.2 and 4.4. However, if we want to spare an OPAMP we may use the active RC band-pass schematic of figure 4.7: C2 6n R1 VCC R2 1.59K C1 30n VI VO -VSS 1K 8 9 10 11 12 OP05 Fig. 4.7: second-order active RC band-pass filter schematic. 2=R2*C2 should be < 1=R1*C1 to maximize amplitude in the pass-band. The frequency responseVCC of this filter is-VSS shown in figure VI 4.8: G( jw) [dB] 20 Log ( R2 V2 w 1 V1 1 V3 ) 20 Log ( ) 20 Log ( ) 2 4m 0 R1 1 ( w 1 ) 1 ( w 2 ) 2 G ( jw.tran ) 270 Amplitude diagram in dB (Bode Plot) 15 10 -15 |G(jw)| [dB] -20 -30 fC1=5,3K -40 fC2=16,7K -50 G(fC1)=2050 G(fC2)=1550 1000000 100000 frequency 10000 1000 100 10 1 1E+07 1000000 100000 10000 1000 100 10 frequency G(jw) -10 255 240 225 210 195 180 165 150 135 120 105 90 artg (w 1 ) artg (w 2 ) .lib Phase ./lib/sub/LTC.lib diagram 2701 1K) SINE(0 0 13 14 15 16 17 18 19 U1 Fig. 4.8: frequency response of the active band-pass filter of figure 4.7. The amplitude diagram is exactly the sum of the Bode plots of a low-pass and a high-pass filter with the same time constants. Looking at the amplitude analytical expression in figure 4.8, we understand it is the sum of an active high pass-filter with gain R2/R1 and time constant 1=R1*C1 and a passive low-pass filter with time constant 2=R2*C2. The phase plot is the sum of the phase plots of the two single filters. Hence, the schematic of figure 4.7 represents the most compact RC band-pass active filter we may use. 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 A band-pass filter provides an interesting example of circuit to be studied with the aid of simulation. A particularly interesting case is that of a square wave input with frequency in the middle of the passband B of the filter. What is the filter output to the square wave stimulus? The analytical approach is too difficult. The graphical approach is practicable but still difficult. In fact, we need to find all harmonic components of the input square wave. Then we need to find the output corresponding to each harmonic component; finally we need to sum all the output to find the final output waveform. Simulation, instead, provides us with the straightforward solution for each kind of filter. We have simulated two different band-pass filters with the same input square waveform. The output of the two filters is different because their frequency response is different. The active filter has a wider pass-band: so the fundamental harmonic “passes”, but also the third harmonic and higher order harmonics “pass”, even if attenuated. The final output result is the blue waveform that is still the combination of many harmonic components. The passive series-resonant filter has a very narrow band: only the fundamental harmonic “passes”, while the third harmonic and all higher order harmonics are “cut”. Hence, the final output result is the red waveform that is sinusoidal with frequency equal to the input square wave: in practice a highly selective band-pass filter is able to select the fundamental harmonic of the input square waveform. What are the practical applications of filters? They are actually used in each electronic circuit; however we will name only two applications we just find in our houses: the ADSL and the Hi-Fi (High-Fidelity) system. If you have an ADSL Internet connection, you realize that you can browse the Internet while simultaneously some other members of your family are speaking on the phone. That‟s not so trivial since the two signals (the ADSL and the phone signal) share the same cable. How is it possible they do not disturb each other? The reason is that the phone signal is in the frequency range [0,8KHz] while the ADSL signal is above 26KHz. In particular, a low pass filter placed before the phone receiver is used to make sure all 22 1 2 3 4 5 frequency components higher than 8KHz are “cut” and do not disturb the phone communication as high frequency noises. On the other hand, a high-pass filter is embedded in the ADSL modem to make sure all frequency components lower than 26KHz do not disturb the ADSL modulation/demodulation and, hence, the Internet communication. Figure 4.9 shows the schematic representation of the filters used in ADSL: A) B) example of sixth order low-pass filter placed before the phone receiver to avoid high frequency noise present in the phone line. 6 7 8 9 10 11 12 13 14 15 16 Fig. 4.9: A) schematic representation of the low-pass and high-pass filters used to avoid disturb when browsing the Internet while speaking on the phone. B) example of low-pass filter actually placed before the phone receiver. Filters are also used in any Hi-Fi system. In fact, the minimum configuration for any Hi-Fi system is two speakers, one woofer to reproduce the bass sounds and a tweeter to reproduce the high sounds. Audio signal high frequency components are “cut” by a low-pass cross-over filter before they reach the woofer. On the contrary, audio signal low frequency components are “cut” by a high-pass cross-over filter before they reach the tweeter. So both speakers can work fine at the maximum power for which they have been desinged. Figure 4.10 shows the simplified schematic of this simple audio system. audio signal [0,20KHz] 17 18 19 20 cross-over low-pass [0,3KHz] woofer (bass) cross-over high-pass [3K,20K] tweeter (high) Fig. 4.10: simplified schematic of a simple audio system made of two speakers: a woofer and a tweeter, each with the corresponding cross-over filter. 23 1 2 3 4 5 6 7 As in the case of the ADSL modem, also Hi-Fi cross-over filters are not first-order. This is because first-order filters are not sufficiently “selective”: frequency components close to the pass-band are not sufficiently attenuated. Figure 4.11 shows the simplified Bode plots of 1st, 2nd and 3rd order low-pass filters. When f=10*fC the first order filter offers only an attenuaton of a factor 0.1 (-20dB). You need a second order filter to have an attenuation factor of 0.01 (-40dB) and a third order filter to reach a 0.001 attenuation factor. Finally a higher order filter is more able to select only the frequencies within its pass-band only high-order filters are usually used in practical applications. |G(jw)| [dB] 0dB fC Note: the order of a filter is equal to the number of reactive -20dB components in its schematic (i.e. the -40dB number of poles of its transfer function). -60dB 8 9 10 10fC 100fC 1000fC f 1 order: -20dB/dec (log) st 2nd order: -40dB/dec 3rd order: -60dB/dec Fig. 4.11: simplified Bode plots of low-pass filters of different orders but with the same pass-band. 24 BIBLIOGRAPHY 1. The Analysis and Design of Linear Circuits, 6th Edition, R. E. Thomas, A. J. Rosa, G. J. Toussaint, ISBN: 978-0-470-38330-8, 2009. (basic textbook on linear circuits analysis with a complete chapter on AC analysis and Bode plots of analog filters). 2. http://www.animations.physics.unsw.edu.au/jw/RCfilters.html (basic analysis of RC filters with animations). 3. http://www.play-hookey.com/ac_theory/filter_basics.html (basic theory of active and passive filters). 4. http://www.educypedia.be/electronics/analogfil.htm (link to several resources on analog filters, both passive and active). 5. http://www.usna.edu/Users/ee/kintzley/ee303sp09/lectures/EE303Sp09_L05_Filters.pdf (lecture on basic filter topologies and solutions). 6. http://dev.emcelettronica.com/performing-ac-analysis-ltspice (method to perform an AC analysis of an RC filter with LTspice) 7. http://www.swarthmore.edu/NatSci/echeeve1/Ref/DataSheet/IntroToFilters.pdf (basic introduction to analog filters from National Semiconductor Corp., with examples of real analog filters IC's and criteria to select among different filter topologies). 8. Active Filter Cookbook, D. Lancaster, 2nd ed. Thatcher, Synergetics Press, 1995 (a comprehensive textbook on active filter design and analysis). 9. http://www.wisc-online.com/objects/index_tj.asp?objID=ACE2803 (analysis of the Bode plots of an RC low pass filter). 10. http://www.che.ttu.edu/pcoc/software/ppt/Chap09.ppt (chapter on Bode plot analysis of linear systems with stability criteria). 11. http://eprints.iisc.ernet.in/13500/1/lec_5_web.pdf (lecture on Bode plots and second order linear systems). 25