# Bode plots

# Transfer functions and Bode plots

To characterize the frequency response of a circuit, it is often helpful to find the **transfer function** of a circuit, as we did in the example above. A transfer function, usually denoted as $ H(\omega) $ or $ H(f) $, is defined to be the ratio of the output voltage to the input voltage as a function of frequency, i.e. $ H(f) = {V_{out} \over V_{in}} $. (Remember that $ \omega = 2 \pi f $.) Also note that only two things can happen to a sine wave passing through a linear, time-invariant system (like an RLC circuit): it's magnitude can be changed; and the signal can be delayed. The delay and percentage change in the magnitude are a function of frequency. Thus, the transfer function is a complex-valued function of frequency that specifies the magnitude and phase shift of a particular system for all frequencies. The change in amplitude is often called the gain, and the delay is usually thought of in terms of a phase shift of the sine wave.

One helpful way to visualize a transfer function is to make two plots, called **Bode plots**. The first plot shows the magnitude of the transfer function verses frequency on a set of log-log axes. (Need a refresher on log-log plots? Click here.)The second plot shows the phase shift versus log frequency. (Traditionally, Bode plots are constructed only using straight-line segments to represent the transfer function by means of straight edges and fine draft pen sets. Since plotting complicated functions is now done by computer, exact plots may be substituted for the traditional methods.)

## Plotting the magnitude of the transfer function

Let's first plot the magnitude of the transfer function as a Bode plot. We will take the RC circuit from the example on the previous page to demonstrate how to create the plot. Recall that the transfer function for the low-pass RC circuit to the right was

- $ H(\omega ) = {V_{out} \over V_{in}} = {1 \over 1+ j \omega RC} $

The magnitude of this function is given by (for a refresher on how to find the magnitude of a complex number, click here)

- $ |H(\omega )| = {1 \over \sqrt {1 + \omega ^2 R^2 C^2}} $

A magnitude Bode plot typically has the y-axis in units of decibels (dB), which is defined to be 20 times the logarithm of the magnitude. More specifically,

- $ |H(\omega )|_{dB} = 20 log |H(\omega )| $

The x-axis is typically in units of radians per second if you're using $ \omega $ or Hz if you're using $ f $. It is also on a log-scale, so you'll usually see it in increments that increase by ten-fold, known as a decade.

#### Step-by-step method to create magnitude Bode plot

- To create the Bode plot of the above transfer function, think about the following:

**Identify the cutoff frequency ($ \omega_c $)**. This is a convenient frequency to think about, where we will consider $ \omega << \omega_c $ to be a low frequency and $ \omega >> \omega_c $ to be a high frequency. You will see why it is called a cutoff frequency soon.- Looking at the denominator of your magnitude function, you can see that at small frequencies the 1 dominates, but at large frequencies, the frequency term dominates. We can say that roughly, where the frequency term begins to play a role is when $ 1 = \omega^2 R^2 C^2 $. At this point, we can rearrange the expression to see that $ \omega = {1 \over RC} $.
- This is what we define to be the cutoff frequency:
- $ \omega_c = {1 \over RC}. $

**What is the value of $ |H(\omega )| $ at low frequencies ($ \omega << \omega_c $)?**- Plug in $ \omega = 0 $ to your magnitude function and you can see that
- $ |H(\omega )| = 1 $, so $ |H(\omega )|_{dB} = 0 $
- Let's plot what we know so far. With a Bode plot we can approximate most things with straight line segments. We will get into more exact details later.

**What is the value of $ |H(\omega )| $ at high frequencies ($ \omega >> \omega_c $)?**- As $ \omega \rarr \infin $, you can see that
- $ |H(\omega )| \rarr 0 $, so $ |H(\omega )|_{dB} \rarr - \infin $ or a very negative number.
- Let's add this information to our plot.

- You're Bode plot pretty much looks complete! How did we know the slope of the line at higher frequencies?
- Let's look at the equation in a bit more detail.
- $ |H(\omega )|_{dB} = 20 log({1 \over \sqrt {1+ \omega^2 R^2 C^2}}) $
- $ |H(\omega )|_{dB} = 20 log(1) - 20 log(\sqrt {1+ \omega^2 R^2 C^2}) $
- $ |H(\omega )|_{dB} = - 20 log(\sqrt {1+ ({\omega \over \omega_c})^2}) $
- $ |H(\omega )|_{dB} = - 10 log( 1+ ({\omega \over \omega_c})^2) $
- When we are considering $ \omega >> \omega_c $, the frequency term dominates the 1, such that
- $ |H(\omega )|_{dB} \cong - 20 log( {\omega \over \omega_c}) $
- Thus, every time the frequency increases ten-fold (a decade), the magnitude decreases by -20 dB. We say that the slope of the line at high frequencies is -20 dB per decade. Now that we know this, we can figure out a quicker way to determine slope, which we will discuss in the next section.

- Next, an important fact to point out is that the straight lines we drew are just approximations, especially near the cutoff frequency. The lines serve as asymptotes. If you take a closer look at what happens near the cutoff frequency, you will see that if $ \omega = \omega_c $,
- $ |H(\omega_c )|_{dB} = - 10 log( 1+ ({\omega_c \over \omega_c})^2) $
- $ |H(\omega_c )|_{dB} = - 10 log(2) $
- $ |H(\omega_c )|_{dB} = -3 dB $
- Thus, people also call the cutoff frequency
**the 3 dB point**. - The following plot shows a little more detail of the actual magnitude of the frequency response of the circuit we evaluated.

- Looking at the plot, you can see the frequency response of your circuit. It becomes clear that at high frequencies, the magnitude of your transfer function becomes smaller and smaller. In other words, $ V_{out} $ becomes much smaller than $ V_{in} $. This is why the circuit is called a low-pass filter. You can also see now why the cutoff frequency deserves its name, since the circuit starts to cut off the signal near that frequency.

Now that you've completed this example, you can follow the same steps to plot the magnitude bode plot for any circuit for which you have the transfer function.

#### Some guidelines for finding slopes in magnitude Bode plots

- Get the transfer function into the form $ H(\omega ) = {A (1+ {j\omega \over \omega_{z1}})^{a1} (1+ {j\omega \over \omega_{z2}})^{a2} ...\over (1+ {j\omega \over \omega_{p1}})^{b1} (1+ {j\omega \over \omega_{p2}})^{b2}... } $
- Anytime you pass $ \omega_z $ from the numerator, the slope of the magnitude plot should increase by $ 20 a $ (the exponent) dB/decade
- For example, when the magnitude plot hits $ \omega_{z1} $, the slope should increase by $ 20 a1 $ dB/decade

- Anytime you pass $ \omega _p $ from the denominator, the slope of the magnitude plot should decrease by $ -20 b $ (the exponent) dB/decade
- For example, when the magnitude plot hits $ \omega_{p1} $, the slope should decrease by $ -20 b1 $ dB/decade

- The effect of each cutoff frequency superimposes on the Bode plot.

- Here is an example. Given a circuit with the following transfer function, let's use the steps of our method to plot the magnitude Bode plot. Assume $ \omega_2 = 10 \omega_1 $
- $ H(\omega) = {1 \over (1+ {j\omega \over \omega_1})(1+{j\omega \over \omega_2})} $

- There are two cutoff frequencies: $ \omega_1 $ and $ \omega_2 $
- At very low frequencies, $ |H(\omega)|_{dB} = 0 $
- As the frequency gets higher, $ |H(\omega)|_{dB} $ becomes increasingly negative

- From the guidelines above, we know that after the magnitude plot hits $ \omega_1 $, the slope decreases -20dB/decade. Then after $ \omega_2 $, the slope decreases by another -20 dB/decade, totaling -40 dB/decade.
- Thus we can draw the following Bode plot

## Plotting the phase of the transfer function

To demonstrate plotting the phase of the transfer function, let's use our low-pass RC circuit shown on the right. Recall that the transfer function is given by

- $ H(\omega ) = {V_{out} \over V_{in}} = {1 \over 1+ j \omega RC} $

- Remember that $ \ang H(\omega) = \ang (numerator) - \ang (denominator) $ (click here for review of complex numbers)
- $ \ang (numerator) = \ang 1 = 0 $
- $ \ang (denominator) = \ang (1+ j\omega RC) = arctan(\omega RC) $
- Thus, $ \ang H(\omega) = -arctan(\omega RC) = -arctan({\omega \over \omega_c}) $
- where $ \omega_c = {1 \over RC} $ is the cutoff frequency

The phase Bode plot has phase on the y-axis in a linear scale, and frequency on the x-axis on a log-scale.

#### Steps to plotting the phase Bode plot

- The steps for creating a phase Bode plot are similar to those for the magnitude Bode plot

**Identify cutoff frequency**: As mentioned above, the cutoff frequency for this transfer function is $ \omega_c = {1 \over RC} $- At the cutoff frequency of this example transfer function, $ \ang H(\omega_c) = -45 \deg $

**What is the value of $ |H(\omega )| $ at low frequencies ($ \omega << \omega_c $)?**- Plug in $ \omega = 0 $ to your magnitude function and you can see that
- $ \ang H(\omega) = 0 $

**What is the value of $ |H(\omega )| $ at high frequencies ($ \omega >> \omega_c $)?**- As $ \omega \rarr \infin $, you can see that
- $ \ang H(\omega) = -90 \deg $

- To draw the Bode plot, we need to connect 0 degrees at low frequencies to -90 degrees at high frequencies. For this, we draw a sloping line that goes from a phase of 0 degrees one decade before the cutoff frequency to a phase of -90 degrees one decade after the cutoff frequency, while passing through -45 degrees at the cutoff frequency. The plot is shown below.

- Remember that the straight line segments are just approximations, and that the actual phase response of the system is has smoother edges.

#### Some guidelines for finding slopes in phase Bode plots

- Get the transfer function into the form $ H(\omega ) = {A (1+ {j\omega \over \omega_{z1}})^{a1} (1+ {j\omega \over \omega_{z2}})^{a2} ...\over (1+ {j\omega \over \omega_{p1}})^{b1} (1+ {j\omega \over \omega_{p2}})^{b2}... } $
- Anytime you pass $ \omega_z $ from the numerator, the slope of the phase plot from one decade before to one decade after $ \omega_z $ should increase by $ 45 a $ (the exponent) degrees/decade
- For example, from $ {1 \over 10}\omega_{z1} $ to $ 10\omega_{z1} $, the slope should increase by $ 45 a1 $ degrees/decade

- Anytime you pass $ \omega _p $ from the denominator, the slope of the phase plot from one decade before to one decade after $ \omega_p $ should decrease by $ -45 b $ (the exponent) degrees/decade
- For example, from $ {1 \over 10}\omega_{p1} $ to $ 10\omega_{p1} $ , the slope should decrease by $ -45 b1 $ degrees/decade

- The effect of each cutoff frequency superimposes on the Bode plot.

- Here is an example. Given a circuit with the following transfer function, let's use the steps of our method to plot the phase Bode plot. Assume $ \omega_2 = 10 \omega_1 $
- $ H(\omega) = {1 \over (1+ {j\omega \over \omega_1})(1+{j\omega \over \omega_2})} $

- There are two cutoff frequencies: $ \omega_1 $ and $ \omega_2 $
- At very low frequencies, $ \ang H(\omega) = 0 $
- As the frequency gets higher, $ \ang H(\omega) $

- From the guidelines above, we know that from $ {1 \over 10}\omega_1 $ to $ 10 \omega_1 $, the slope decreases -45 degrees/decade. Then from $ {1 \over 10}\omega_2 $ to $ 10 \omega_2 $, the slope decreases by another -45 degrees/decade. Superimposing this gives a -90 degree/decade slope between $ \omega_1 $ and $ \omega_2 $.
- Thus we can draw the following Bode plot

# Examples of frequency responses for common filters

The following plots are magnitude and phase Bode plots of common types of filters:

A) | B) |

C) | D) |

Note that the axes are the same, except for the y-axes of the phase plots for visualization purposes. We also will use $ f $ here for convenience, instead of $ \omega $.

A) A **first-order low-pass** filter can be constructed by a resistor and a capacitor, as seen in the examples used in the previous section, where the transfer function is given by

- $ H(f) = \frac{V_{out}}{V_{in}} = \frac{1}{1 + j2\pi f RC} $.

- In this case the cutoff frequency is given by $ f_C = 1 / (2\pi RC) $.
- For frequencies
*below*$ f_C $, the gain is nearly flat (in this case at 1 or 0dB). - For frequencies
*above*$ f_C $, the gain drops off by a factor of 10 for each decade in frequency (expressed here in dB as -20dB/decade). - At low frequency, the phase starts out at 0°, but starts to decrease noticeably at about $ f_C $/10, drops to −45° at $ f=f_C $, and asymptotes at -90° above 10×$ f_C $.

B) A **first-order high-pass** filter may be constructed simply by exchanging the R and C components of the low-pass filter. The high-pass filter transfer function is given by

- $ H(f) = \frac{j f / f_{\rm HP}}{1 + j f / f_{\rm HP}} $
- $ f_{\rm HP} $ is the cutoff frequency (the same as before).
- In this case the gain is 1 only for frequencies $ f>f_{\rm HP} $ and falls off for frequencies below $ f_{\rm HP} $.
- The phase plot has the same shape as the the low-pass case, but starts at +90° at low frequency and goes to 0° at high frequency.

C) A **second-order low-pass** filter can be constructed by cascading two low-pass filters together in series. Assuming the cutoff frequency of the two filters are the same and the second stage does not load down the first stage significantly (remember input and output impedances), the transfer function can be represented by the square of a 1st-order low pass,

- $ H(f) = \left(\frac{1}{1 + j f / f_{\rm LP}}\right)^2 $
- This frequency response looks very similar to that of the 1st-order low pass, but the slopes of the curves are different.
- The phase again starts out at 0° at low frequency and goes to -180° at high frequency. For frequencies above $ f_{\rm LP} $, the gain drops off at -40dB/decade.
- Remember this is a log scale, so the gain attenuates by a factor of 100 at $ f=10f_{\rm LP} $ (and 10000 at $ f=100f_{\rm LP} $). The 2nd-order filter is considerably more effective at filtering out undesirable frequencies.

D) A **band pass** filter can be constructed from appropriately chosen low-pass and high-pass filters in series (be careful with input and output impedances)

- $ H(f) = \frac{j f / f_{\rm HP}}{1 + j f / f_{\rm HP}} \times \frac{1}{1 + j f / f_{\rm LP}} $
- If $ f_{\rm HP}<<f_{\rm LP} $, the gain is 1 (0dB) for frequencies $ f_{\rm HP}<f<f_{\rm LP} $.

The transfer function plots were generated by the Matlab script wikibodeplots.m. Feel free to try it on your own.