Dave shows you a neat trick on how to get a real time frequency response bode plot on your oscilloscope using your function generator. Useful for filter or system response characterisation.
Forum Topic: http://www.eevblog.com/forum/blog/eevblog-396-bode-plotting-on-your-osciloscope/'>http://www.eevblog.com/forum/blog/eevblog-396-bode-plotting-on-your-osciloscope/
Spectrum Analyser Video: http://www.youtube.com/watch?v=Wg3PNgGW_M4
EEVblog Main Web Site:
http://www.eevblog.com
EEVblog Amazon Store:
http://astore.amazon.com/eevblogstore-20
Donations:
http://www.eevblog.com/donations/
Projects:
http://www.eevblog.com/projects/
Electronics Info Wiki:
http://www.eevblog.com/wiki/

Hi I Was recently playing around with some filters and I wanted to get the frequency response plot of the actual filter I.E a Bod plot amplitude versus frequency and uh, you've seen me do these in the videos before, in simulations and various other things. but I wanted to actually measure the response and well as you do I Got to thinking: is it possible to get a frequency response or Bode plot on an oscilloscope H I think there's a way to do it? Let's have a go now. In a recent video which I'll link in here I've showed how to do this with a spectrum analyzer with a tracking generator. Very useful for getting uh, a frequency characteristic or frequency response plot of a filter or something like that if you've got the tracking generator option.

but R But these RS Spectrum analyzers are only good for RF IE 9 khz up to 1.5 GHz So they're no good for like audio frequency or other lower frequency stuff. So what would you use to measure lower frequencies? Well traditionally you use a what's called a dynamic signal analyzer or one of these Fft analyzers and the these have really fantastic uh, dynamic range. You know, huge resolution. uh adcs in these things.

Excellent noise. Flor They're really the bomb for doing um, uh, you know low frequency sound and vibration measurement and stuff like that. So what do you do if you haven't got one of those and well, yeah, you can use a sound card. A lot of people will say that you know they've got a a reasonable, uh, you know, an audio type, uh, bandwidth and you can do the job with one of those.

You can generate signals with the deck on the card of course, and um, measure it in with some audio inputs so well, we don't want to do that. So how would you do this on the oscilloscope? Well, ordinarily, you cannot get an oscilloscope to display frequency on its uh, horizontal axis unless you do an Fft, which isn't really suitable in this case. So the way you normally get a frequency response plot with an oscilloscope is, in fact, you don't even need an oscilloscope, You just need a multimeter and a function generator. You've seen me.

uh. Also, do this before: manually measuring the frequency response of an amp fire. Where you, uh, sweep the Uh where you turn up the input frequency and you get a bit of paper and you write down values at spot frequencies as you go up in frequency. you write down the amplitude either from an oscilloscope or you can do it with a multimeter as well if it's got sufficient uh bandwidth.

So that, and then you, uh, enter those. uh, enter all those tables and numbers into your spreadsheet and you generate your frequency response graph. But we don't want that. We want to actually generate a Bode plot or a frequency response Po plot in real time on the screen.

So if we got a low pass filter I want to see it go like this and then drop down like that? You might think it's impossible, but there's a neat trick that allows you to do this. So a quick recap on what a frequency response or Bode plot is is a graph of amplitude on the Y AIS here versus frequency and the way you normally get it is to sweep a signal through through your filter over the desired frequency range like that and you will get response plot. In this case we've got a band pass filter here because as you can see, it passes frequencies in this band here and then it drops off on either side. And of course you know we've got a traditional band pass opamp filter there and you can get different responses in terms of like low pass, high pass and the band pass.
and you can also get band stop filters as well. So we are going to try and see if we can get this response on our oscilloscope. Now ordinarily you wouldn't be able to do this because an oscilloscope does not display anything versus frequency. it displays it versus time.

And of course we've got different types of axes as well. You can have a logarithmic uh, DB vertical um amplitude axes here and you can also have a decade or logarithmic Um or octave uh, or linear axis for the frequency. So we're going to see if we can get linear for Um for starters and then possibly get a logarithmic one as well. So you might be thinking, well, the oscilloscope has Fft built in.

Well, that's not going to really do the job in this case. So we're going to actually trick the oscilloscope into displaying frequency on its horizontal axes. It's a lot easier than you think. Let's go now.

What I've got here is my Ryol function generator I've got it set to do a sign frequency sweep. so it's in sine wave mode, it's in sweep mode, and I've got it set here for uh, a 1 Second Sweep So it takes 1 second to do the entire frequency sweep and uh, it starts at 1 Herz and goes to 100 khz. I Mean these are just round numbers I've picked. You can do it for, you know, almost any frequency range you desire.

So we've got a 1 Second Sweep. So if we go, look at that signal, this is what is generating. I mean it starts out at 1 Hertz and it goes all the way up to 100 KZ there. Now if we hook this up to a filter which I will do right here, I'll insert a filter and you can see it actually changing.

We can actually see that there. it's starting off and it's going down like that and you can sort of start to see a response plot on this and it's It's kind of sort of there. It's kind of sort of doing it, but we're going to make it much nicer. How are we going to do that? Well, we're going to do that by something I've mentioned before the Snc or trigger output on the function generator.

So what I've got that hooked up to is Channel two on the Uh scope. Here Here we go and we'll turn on Channel two and it generates a syn pulse when it starts that frequency sweep. and when it ends like that during that whole period, one complete cycle of that trigger pulse that is our entire frequency range. So from there it starts out at 1 Herz in this case that I've programmed in goes up to 100 khz.
So that's our entire frequency uh range there and you can see that we have a response in there and that is a real linear amplitude response of the filter. I've got put in here and if I turn the filter off There we go. We get get a straight line of course because the amplitude from the function generator is flat across the frequency range. So what we want to do is at the moment we're triggering off our Channel One signal up there.

We don't want to do that triggering off our actual signal. We want to trigger off this nice, clean, perfect Uh Trigger or gate in uh, pulse down here. So we're going to trigger. We'll trigger off Channel Two, thank you very much.

Positive sloping: Edge and Bingo will now find that we have a signal let's that is triggered every single time it starts here. you can see the triangle up there and it's repetitive. and we can get our frequency response plot on the scope like that. So, but really, we want to, uh, actually get the largest dynamic range possible and also, um, measure over and you know, get it.

sort of like full screen there. So we're just going to change our vertical down to here like this. so the ground point is just right at the bottom there. Bang There it is right there and we'll change our horizontal and because we' set it for 1 second, it's going to be an exact multiple.

So it starts Rising Here it goes there and it rises just there again. So as it turns out it, we can maximize because we've chosen that nice round value which fits on our screen of 1 second period. At 100 milliseconds per division, we got 10 divisions on the screen. Um, that is our complete frequency sweep from 1 Herz up to 100 khz.

and Bingo! Look, we've got our frequency response plot because half of the waveform is below we. We don't want that, We want that set below the ADC range. and now we're maximizing the full use of our ADC. Now what I've got here is a very simple RC filter.

For starters, I've got a 2.2 Narad cap. It's just what I had handy and I've got my decade resistance box here, got it set to 10K and we'll be able to uh, double check these values with the simulator and see if we get exactly the same response plot. So let's go up here and have a look at our response with those two values in there and look at that. It's remember this is a linear uh range on the bottom here.

so this is a linear scale and also the amplitude is linear as well. but we'll be able to do log frequency scale in a minute. So as you can see, we get a response here that drops off and then levels out like that. Now to get the full maximum use of the screen here, and the ADC Remember the Scopes only got a lousy 8bit ADC in it, so it's not nearly as good as a real, you know, a dynamic signal analyzer or Fft analyzer with a much higher dynamic range ADC in it.
But we can get our frequency response plot like that no problems at all. And if I adjust the fine vertical scale there just so it you know I could I could tweak the function gen value as well, but I think that's pretty close to the maximum value there. So we're getting the full screen in there and it's going down to, you know, ah you, you know, maybe 7% of the full value up there. Maybe 8% of the full scale value at 100 khz.

Now let's see if we get that identical response plot on our simulation. All right. I'm running LT spice here I've got the same values 10K and 2.2 nanofarads there I've got my um uh Source set up to uh sweep. So let's go into edit simulation command I'm doing AC analysis which is going to give our B plot.

the type of sweep we want is linear because that's what we're doing with our function generator. We're doing a linear sweep and the start frequency is 1 Herz and the stop frequency is 100 khz. exactly the same as how we've set up on our function generator. So let's give that a go and we'll be able to get our bod plot if we run it.

There it is. Let's actually go into full screen there and Bingo! Look at that. We get exactly the same response. Actually, let's go fit this to manual limits here.

Let's say 1 V 100 molts. Uh the we're setting up the just the vertical axis here. vertical axis is linear exactly like it is on the scope and look at that. That is exactly.

If you actually scaled that to the correct uh dimensions and you overlay that over the that oscilloscope screen response, you would get exact exactly the same response. Bingo Perfect And once again down here. This value down in this uh, bottom right corner around here at 100 khz is there. There it is.

It's around about 6 or seven or so, uh%, of the full scale value. It's exactly the same. So our little trick works. We're able to get frequency response or bod plots on an oscilloscope piece of cake.

But what happens if we want to get a log response on our frequency here? Well, let's have a look at what it will look like on the simulator here. We'll just, uh, manual limits again and we go logarithmic horizontal axes here. and bingo it looks like that because it starts to roll off at around about here. you know, 707 and it goes down to the same value at 100 khz of course, but it looks different.

It's exactly the same response, but it's plotted on a logarithmic axes. Can we get that on our scope? You bet we can. All we have to do for that is go into our sweep menu here and sweep type linear. We don't want linear, we want log and TDA look at what we've suddenly got here on our scope.

Magic. And once again, if you overlay the two, scaled them correctly, you would get exactly the same response. Look at that, and uh, obviously down at the uh, low end down here. Of course you know it's you've just got to use your imagination to extend it down at that, uh, low frequency with this logarithmic axis.
But there you go. Now of course we have to assume that the line is you know, the peak of the waveform here. If you wanted to actually get an actual line like that, you would have to have some sort of Uh Peak detector or RMS uh converter or something like that on the input to your scope so that instead of showing the actual waveform, it shows the peak or the RMS value. and then you would actually get a line just like you do on the Um simulators.

So although this works a treat I thought we'd Just for kicks, do a Uh band pass filter as well. So I'm going to lash up this little thing. It should be centered around about 50 khz or so uh with like a 10 khz um pass band or thereabouts. So you know that'll should be without changing anything on a scope.

It should be smack in the middle so somewhere there the tolerances will be a bit off may not have the exact values, but we'll get the idea. and here we go lashed up on the breadboard. I Took a few liberties with the Uh values, but uh, we're still going to get a ban pass response somewhere within that range. Let's check it out.

Tada And here it is Beautiful. Look at that. It's um, happens to be around about I don't know 18 khz or thereabouts. So look at that beautiful response and uh, of course we could.

Uh, let's adjust our frequency range on this thing. so let's go into our end frequency for example, there it is, it's highlighted. Let's go to uh, well, let's just uh, go to 40K For example, there we go and Tada we're back. So there you go.

We're now from 1 Herz to 40 khz. So we're because we're doing a linear sweep again. we've got off log. So we're doing um, 4 khz per division here.

so 4, 8, 12, 16. Yeah, you know it was around about that 18 that we guessed before. ha. Love it all right now let's say we wanted to zoom in on that.

I Mean we can do that with the uh horizontal of course. but uh, the proper way to do it is to um, adjust our sweep frequency range instead of going from one Herz to 40 khz we've got at the moment. I.E 4 khz per division. Let's go from say 8 up to I don't know 28 or something like that.

So if we jump on over here, we can just go from the start from 8 khz to end frequency 28 khz and Tada There it is, we've swept over a different frequency range and of course once again we would uh, scale our. we would use our uh vertical verer here and scale that Peak to full scale so that we can get a um so you know so that that's our reference point and then we can measure uh, various amplitudes, reference to the full scale using the graticule and all the cursors. Brilliant! And of course, if we Zoom that out like that, we can actually get the multiple responses like that. but of course you just, uh, wasting your horizontal uh screen real estate there.

so you really want to just make sure you choose that exact uh time period to fit your 10 horizontal divisions and you can divide nicely and just remember to keep the vertical adjusted with your Veria That's what your Veria is good for to full scale. or you can adjust the Uh amplitude on the function gen as well. And of course, if we tried to get this response the oldfashioned way by just sweeping our function gen here through the entire range and then manually recording down on a bit of paper. You know each value at each specific frequency you you know you might get you know, 20, 10, or 20 uh points, or even more 50 points or something like that.
Um, then you could get your frequency response and it will look, you plot it on XL or whatever. you'd get exactly the same thing. So there you go, a poor man's bod plotter using your oscilloscope I Like it. It's neat, but yeah, there's going to be some limitations, but look, we are getting a response we can uh, capture that you know to uh, jpeg or whatever and we could uh, label the axes and do everything and that would be a perfectly adequate uh, you know, waveform to put in your report or something like that so you know it is certainly, uh, doable and it's real time.

that's the thing. I mean I can go in there and touch. Let me, uh, sort of touch some Caps or something like that. Let's have a play around.

Can I do that? Yeah, there we go and we going see it all changing in real time which is fantastic. I like it so it does actually work. But yes, there's going to be some limitations I mean the main one? Of course you know we're only talking about an eight, an 8bit um ADC in this thing. So we don't have a huge dynamic range and no, you can't really use the Um High dynamic range uh functions the Box Car average in function of this thing.

I mean if we go in there and we turn that on, we're really going to screw that up with the high resolution mode on this thing. It's not going to work that well at all. and of course you can still turn on Peak detect and capture uh Peaks and things like that and uh, so it. it does.

actually, um, work. just keep it in normal mode. You'll be able to do this on your analog uh scope as well. Don't necessarily have to do it on a digital.

We're using nothing fancy, just a regular oscilloscope. And and of course, the good thing with this is that you can use it over a fairly wide frequency range depends on what your sweep generator is capable of and um, the bandwidth of your oscilloscope. But if you know, don't go near the you know, the upper frequency of It Don't Go Near the uh, maximum sample rate of your oscilloscope curse. You're going to start Alas, in so you don't want that to happen.

but there you go. I Think this is a neat little, um, it's not really a hack, it's just a neat little um, old turn it use for your oscilloscope. I like it. So if you want to discuss it, jump on over to the Eev blog forum and remember if you like it, please give it a big thumbs up.
and don't forget, follow me on Twitter cuz that's where I rant a lot. Catch you next time.

Avatar photo

By YTB

21 thoughts on “Eevblog #396 – bode plotting on your osciloscope”
  1. Avataaar/Circle Created with python_avatars Tuga Minhoto says:

    Thank you so much, fantastic.

  2. Avataaar/Circle Created with python_avatars Simple_Zhou says:

    6,่ฆๆ˜ฏๆต‹่ฏ•็”ต่ทฏ้‡Œๆœ‰้ซ˜qๅ€ผld็š„่ฏไผšๅฝฑๅ“ๅ“ๅบ”้€Ÿๅบฆๅงโ€ฆ

  3. Avataaar/Circle Created with python_avatars Ernest B. says:

    great

  4. Avataaar/Circle Created with python_avatars sby Bill says:

    Two big thumbs up for you Dave!!!

  5. Avataaar/Circle Created with python_avatars Paul C says:

    I use this trick mainly on my CRO , lovely trick Dave.

  6. Avataaar/Circle Created with python_avatars PMKKO says:

    what is channel 2 connected to and why?

  7. Avataaar/Circle Created with python_avatars PMKKO says:

    draw and explain how the circuit works……………………

  8. Avataaar/Circle Created with python_avatars RC Arendsen says:

    This is what i never thought off … I had to measure / test some filters while building phase shifters and compensation filters…

    Thank you ๐Ÿ˜Š๐Ÿ‘

  9. Avataaar/Circle Created with python_avatars Tomasz Mazurek says:

    Wow, this will come in so handy – I recently specifically build myself a mini lab to learn more about audio range filters and was a bit baffled that there are no affordable audio frequency range spectrum analyzers. Now I will know how to solve that problem.

  10. Avataaar/Circle Created with python_avatars Pitipu Corrado says:

    Dave! This is an old video, but I watched it when I was in middle school, now I'm in my third year of EE! You have no idea how much of an inspiration you've been.

  11. Avataaar/Circle Created with python_avatars Jess Stuart says:

    Another way is to take the FFT of the impulse response. But you would need a fast pulse generator.

  12. Avataaar/Circle Created with python_avatars Jess Stuart says:

    You don't absolutely need a Spectrum Analyzer with a tracking generator to generate a frequency response plot. If the spectrum analyzer has peak tracking, you can use a slow sweeping (or manual sweeping) signal generator. You will need to set the resolution bandwidth pretty high, and the sweep rate should be very slow. It may take a minute or two to sweep a few hundred MHz, but you can do it.

  13. Avataaar/Circle Created with python_avatars Harshad Byadgi says:

    remarkably innovative

  14. Avataaar/Circle Created with python_avatars Prof. Marco Cรขmara says:

    Great video! Thanks.

  15. Avataaar/Circle Created with python_avatars Ted says:

    Block 'em Dave. Keep your videos coming. I find them very easy to follow and very educational. Thanks for taking the time to share your knowledge.

  16. Avataaar/Circle Created with python_avatars Edw590 says:

    Wow, thank you! Was wondering if it would be possible to do this, and seems it is!

  17. Avataaar/Circle Created with python_avatars Ryan Byrne says:

    Watching this in 2021 and its still useful

  18. Avataaar/Circle Created with python_avatars ted kaczynski says:

    i do know for a fact that if i drift off to sleep during a series of lectures, yours will snap me awake. this is a good thing. you do need to pronounce 'bode' correctly. two syllables. you've taught me a lot — many thanks.

  19. Avataaar/Circle Created with python_avatars Dave Kendall says:

    Funky use of the scope. Interesting video however I will have to watch it a few more times as I can't stop ogling at that MSO. I love Agilent "one day" so before I get arrested thank you for making this video. What a winner!

  20. Avataaar/Circle Created with python_avatars AferVentus says:

    How to achieve the same result with a psg9080 and a atten 1102cal? How to sync sweep output with trigger?

  21. Avataaar/Circle Created with python_avatars kay bhee says:

    thanx boss…..

Leave a Reply

Your email address will not be published. Required fields are marked *