here's the B plot from the data sheet of opamp what does it mean what are the phase and gain where did the plot come from don't worry if you're feeling lost in all those lines I'll walk you through the diagram and then we'll explore all the beautiful math that lets you really unlock the secrets of the bod diagram even though there's only one graph here there's actually two sets of vertical axes one for the face phase and one for the gain phase and gain aren't complicated Concepts on their own phase is how far a sinusoid has been shifted along a horizontal axis relative to its period phase is typically measured in degrees a phase shift of 360° corresponds to a shift of one period gain is how much the magnitude of the signal has increased usually measured in Deb or DB suppose a signal quadruples in magnitude it has undergone a gain of 6 DB calculated as 10 log 10 of the final amplitude divid by the starting amplitude irritatingly sometimes it is calculated with a multiplier of 20 instead of 10 so watch out for that notice the gain isn't a characteristic of a signal by itself like amplitude instead it is a measure of how a sign sign amplitude has changed this is really what the bod diagram tells us how a signal changes when passing through a system but there's more the bod plot doesn't illustrate how just one signal changes but how signals of various frequencies are affected the bod diagram game plot depicts how the magnitude of signals change as they pass through the system in this op amp circuit low frequencies are Amplified at 100 khz signals are Amplified by nearly 20 DB that's an amplification of 100 times at higher frequencies the gain diminishes at a frequency of 300 khz the gain drops to 5 DP equivalent to an amplitude multiplier of about 3.2 this trend continues and we reach Z DB at about 700 khz implying no gain or loss in the signal notice that both the frequency and gain axes are logarithmic this is typical in a bodh diagram the logarithmic axes can be confusing but make a broad range of frequencies and gains intelligible from a single graph look how how difficult it is to read The High Frequency behavior from the same data plotted on linear axes at high frequencies this upamp feedback circuit doesn't even produce a gain signals lose amplitude diminishing by 20 DB at 4 mahz that's a 100 fold amplitude loss often we're mainly interested in the game plot but let's not forget about the phase unlike the gain the vertical axis of the phasee plot is linear but is plotted against the same logarithmic frequency axis for this opamp circuit there's a 90° phase shift at 100 khz that means the output signal is offset from the input signal by 1/4 the period to the left note that I'm ignoring the gain characteristics to simplify the illustration as frequencies increase the phase approaches zero at 3 MHz the input and output signals are in Phase if you're interested in Bodi plots you're probably already familiar with the forier transform you can use a forier transform to calculate the frequency content of a signal a common way to plot the frequency content of a signal is using magnitude and phase plots but you might wonder how are these different from the gain and phase plots of the bod diagram let's return to our op amp example an input signal V in is applied to the Circuit the op amplifies the signal resulting in V out the frequency content of the input signal can be analyzed by plotting the magnitude and phase of its fora transform this input signal has Peaks at 400 khz and 2 mahz the output signal shares the 400 khz Peak but the 2 mahz Peak has diminished this is a typical use of the forier transform to compare the frequency content of signals the bod diagram on the other hand doesn't characterize individual signals instead it illustrates the relationship between input and output signals of a given system at 400 khz the bod diagram shows an amplification this is what we observed in the frequency content of the output signal overall this B diagram illustrates that low frequencies are Amplified while high frequencies are attenuated compare the forier magnitude plots of the input and output signals and you'll notice those changes it's worth noting here that bod diagrams aren't valid for any system they are only valid for linear time invariant systems usually abbreviated LTI a linear system requires that the effect of the system applied to separate signals is equivalent to the linear combination of the signals affected separately time invariance requires that the effect of the system on an equal input signal at a later time will be the same so how do you know if your system is LTI usually it's because you've written the differential equation for your system and it's linear and has no explicit time dependence here's a couple examples of non LTI systems explicit time dependence in s of T nonlinear cubic term in X of T cubed you can't really understand a bod plot until you know how it was created in this chapter of the video I'll build up the B diagram for this RC circuit starting from scratch this will involve some math but don't worry I'll walk you through the steps let's start by deriving the OD for the output voltage kof's voltage law tells us that the net voltage around the closed loop will be zero we're interested in the voltage drop across the capacitor because that gives our output voltage so we want to write everything in terms of VC using the relationship between voltage and current in a capacitor and the fact that the current is constant in this simple circuit we can rewrite the voltage across the resistor in terms of VC we don't need to rewrite vs because we're assuming it's an arbitrary input voltage signal unrelated to the Dynamics of the RC filter let's look at a solution of this OD assuming an input sinusoid with a frequency of 10 Hertz if I was back in undergrad I'd use my favorite technique with complex exponentials to solve this but this isn't a video about solving Odes so let me just write out the solution I've written the solution for an RC circuit with a 100 kiloohm resistor and a 1 microfarad capacitor if we plot the solution VC and the input signal vs we'll notice that the magnitude has diminished and the phase has shifted the phase shift of the sinusoid is approximately 81° the gain is around 8 DB notice that the phase and gain are calculated only from the periodic term in the solution we ignore the transient term when Computing the gain and phase because it has no effect on the long-term behavior of the the system this exponential decay transient is particularly shortlived affecting only the first couple of Cycles the phase and gain of the long-term periodic behavior of this 10 Herz signal represent a single point in the bod plot we could fill in the rest of the bod plot by varying the input frequency and Computing the phase and gain from the OD solution but there's actually a much cleaner way to construct the bod diagram analytically let me show you transfer functions are a standard tool for analyzing LTI systems like our RC circuit OD there are two steps to compute the transfer function first we'll take the llao transform of the OD it sounds hard but there are simple rules for the Lao transform that you can find in a table that makes it quite easy applying these rules yields the lass domain form of the OD the transfer function is the ratio of the output signal VC to the input signal vs in the LL domain a little algebra and we're there the RC circuit transfer function models both the transient and long-term behavior of the system restricting the llao domain independent variable s to its imaginary term I Omega limits our analysis to the long-term periodic Behavior the gain is calculated by Computing the magnitude of the complex transfer function and then taking its log the phase is the depicted angle in the complex plane it can be computed using the arc tangent to construct the bod diagram we simply plug in a range of frequencies and plot the resulting phase and Gain here's the resulting bod plot for this RC circuit you can see that the OD solution phase and gain are equal to the phase and gain calculated using the transfer function this RC circuit is a low pass filter because it attenuates high frequencies but allows low frequencies to pass here's another way you can create a bod diagram probe a physical system with multiple frequencies if you record the inputs and outputs you can compute the frequency response and use the result to plot the B diagram gain and phase here I've created an RC circuit with a 10 kohm resistor and a47 microfarad capacitor here is the assembled circuit let's try probing the circuit with a chirp signal I'll generate the chirp in the Arduino IDE here's the line where it's computed and here's where it's written to the digital to analog converter to record the inputs and outputs for processing I'll use a simple python script here's where we read from the serial Port here's a video of the recorded input and output signals in a fixed time window the input chirp signal starts at 1 Herz and ramps linearly to 1 khz the output signal shows gradually increasing attenuation plotting both signals together illustrates this nicely it's just a few lines of code to compute the fast forier transforms commonly called ffts of these discrete time signals the input chirp signal covers a broad range of input frequencies the output signal has a similar frequency range but has been modified by the RC filter if we take the ratio of the output fora transform to the input we obtain the same result as the transfer function frequency response if we compute the phase and gain of this ratio we'll have the bod plot phase and gain curves here are the plotted curves you can see that after 1 khz where the chirp signal stopped there's no usable data but in the the rest of the range we see the characteristic low pass filter curve compare that to the analytic B plot for this circuit surprise they actually match I hope this video helped you to understand B plots please let me know what other content you'd like to see in the future