EEVblog #396 - Bode Plotting on Your Osciloscope

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi I was recently playing around with some filters and I wanted to get the frequency response plot of the actual filter ie a bode plot amplitude versus frequency and you've seen me do these in the videos before in that 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 hmm 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 a frequency characteristic or frequency response plot of a filter or something like that if you've got the tracking generator option but IRA but these RF spectrum analyzers are only good for RF ie9 kilohertz up to 1.5 gigahertz 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 they had these have really fantastic dynamic range and a huge resolution a DC's in these things excellent noise for they're really the bomb for doing 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 say that you know they've got a a reasonable you know an audio type our bandwidth and you can do the job with one of those you can generate signals with the DAC on the card of course and 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 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 oscilloscope you just need a multimeter and a function generator you've seen me also do this before manually measuring the frequency response of an amplifier where you are sweep the 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 or write down the amplitude either from the Scylla scope or you can do it with a multimeter as well if it's got sufficient bandwidth so that and then you are into those 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 plot plot in real time on the screen so I forgot a low-pass filter I want to see it go like this and then drop down like that you might think is 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 axes here versus frequency and the way you normally get it is to sweep a signal through your filter over the desired frequency range like that and you will get response plot in this case we've got a bandpass 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 bandpass saw op-amp filter there and you can get different responses in terms of like a low-pass high-pass and the bandpass and you can also get band stop filters as well so we I can try and see if we can get this response on our Scylla scope now ordinarily you wouldn't be able to do this because in 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 DB vertical amplitude axes here and you can also have a decade or logarithmic or octave or linear axes for the frequency so we're going to see if we can get linear for our first starters and then possibly get a logarithmic one as well then 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 goal function generator I've got it set to do a sine frequency sweep so it's in sine wave mode it's in sweep mode and I've got it set here for a 1 second sweep so it takes one second to do the entire frequency sweep and it starts at 1 Hertz and goes to 100 kilohertz 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 and look at that signal this is what is generating it starts out at 1 Hertz and it goes all the way up to a hundred kilohertz 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 they're 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 sorted 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 UH sync or trigger output on the function generator so what I've got that hooked up to is channel 2 on the scope here here we go and we'll turn on channel 2 and it generates a sync 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 Hertz in this case that I've Pro in goes up to a hundred kilohertz so that's an entire frequency 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 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 into want to trigger off this nice clean perfect trigger or gating pulse down here so we're going to trigger will trigger off channel 2 thank you very much positive sloping edge and bingo will now find that we have a signal as that is triggered every single time it starts here you can see the triangle up there and it's repetitive and we can get a frequency response plot on the scope like that so but really we want to actually get the largest dynamic range possible and also measure over and you know get it sort of like fullscreen there so we just got 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're set it for one 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 one second period at 100 milliseconds per division we've got 10 divisions on the screen and that is our complete frequency sweep from 1 Hertz up to 100 kilohertz and bingo look we've got our frequency response plot because half of the waveform is below we we don't want that we that's 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 nano farad 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 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 is to remember this is a linear 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 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 allows the 8-bit 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 Generale you 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 know maybe seven percent of the full value up there maybe eight percent of the full scale value at 100 kilohertz now let's see if we get that identical response plot on our simulation all right I'm running ltspice here I've got the same values 10k and 2.2 nanofarads there I've got my source set up to sweep so let's go into edit simulation command I'm doing AC analysis which is going to give our bode plot the type of sweep we want as linear because that's what we're doing with our function generator we're doing a linear sweep and the start frequency is 1 Hertz and the stop frequency is 100 kilohertz exactly the same as how I've set up on our function generator so let's give that a go and we'll be able to get our Bo 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 volt 100 milli volts these we're setting up the just the vertical axes 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 dimensions and you overlaid that over the that oscilloscope screen response you would get exactly the same response bingo perfect and once again down here this value down in this bottom right corner around here at 100 kilohertz is there there it is it's around about 6 or 7 or so percent of the full-scale value it's exactly the same so a little trick works we're able to get frequency response or bode plots on an oscilloscope piece of cake but what happens if we want to get a log response and our frequency here well let's have a look at what it will look like on the simulator here we'll just 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 0.707 and it goes down to the same value at 100 kilohertz 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 a sweet menu here and sweep type linear we don't want linear we want log and tada look what we've suddenly got here on our scope magic and once again if you overlay the two scale done correctly you would get exactly the same response look at that and obviously down at the low end down here of course you know it's you've just got to use your imagination to extend it down at that low frequency with this logarithmic axes 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 a peak detector or RMS 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 simulators so although this works a treat I thought we'd just for kicks do a bandpass filter as well so I'm going to lash up this little thing it should be centered around about 50 kilohertz or so R with like a 10 kilohertz a passband or thereabout so you know that'll it should be without changing anything on a scope it should be smack in the middle 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 values but we're still going to get a bandpass response somewhere within that range let's check it out tada and here it is beautiful look at that it some happens to be around about our 18 kilohertz or there abouts so look at that beautiful response and of course we could 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 well let's just go to 40 K for example there we go and tada we're back so there you go we're now from one Hertz to 40 kilohertz so we're foot because we're doing a linear sweep again we've got off log so we're doing four kilohertz per division here so four eight twelve sixteen yeah you know it was around about that eighteen that we guess before haha love it alright now let's say we wanted to work Suman on that I mean we can do that with the horizontal of course but the proper way to do it is to adjust our sweep frequency range instead of going from one Hertz to 40 kilohertz we've got at the moment ie 4 kilohertz per division let's go from say 8 up - 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 kilohertz to end frequency 28 kilohertz and tada there it is we've swept over a different frequency range and of course once again we would scale out we would use our vertical vernier here and scale that peak to full scale so that we can get a em so you know so that that's our reference point and then we can measure our 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're just wasting your horizontal wire screen real estate there so you really want to just make sure you choose that exact time period to fit your 10 horizontal divisions and you can divide nicely and just remember to keep the vertical adjusted with your vernier that's if only is good for to full scale or you can adjust the amplitude on the function Generale and of course if we try to get this response the old-fashioned way by just sweeping our function Jen here through the entire range and then manually recording down on a bit of paper you know each value on each specific frequency you know you might get you know 2010 or 20 points or even more 50 points or something like that then you can get your frequency response and it will look you plot it on excel or whatever you get exact we the same thing so there you go a poor man's bode 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 capture that you know to a JPEG or what everyone we could label the axes and do everything and that would be a perfectly adequate you know wave form to put in your report or something like that so you know it is certainly doable and it's real time that's the thing I mean I can go in there and touch let me 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 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 put an 8-bit ADC in this thing so we don't have a huge dynamic range and no you can't really use the high dynamic range functions the Boxcar averaging 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 that peat detect and capture Peaks and things like that and so it does actually work just keep it in normal mode you'll be able to do this on your analog scope as well don't necessarily have to do it on a digital we're using nothing fancy just a regular oscilloscope 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 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 maximum sample rate every oscilloscope case you're going to start a listen 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 alternate use for your cell the scope I like it so if you want to discuss it jump on over to the eevblog for it and remember if you liked it please give it a big thumbs up and don't forget follow me on Twitter because that's where I rant a lot catch you next time
Info
Channel: EEVblog
Views: 126,919
Rating: 4.9478827 out of 5
Keywords: bode plot, oscilloscope, filter, graph, frequency response, curve, how to, function generator, fft, simulation, bandpass, bandstop, low pass, high pass, filtering, characterisation, agilent, rigol, tektronix, digital oscilloscope, tutorial, envelope detector, peak detector, detector, signal, external trigger, triggering, gating pulse, dual channel, dso3000x, msox3000, review
Id: uMH2hGvqhlE
Channel Id: undefined
Length: 20min 26sec (1226 seconds)
Published: Fri Dec 07 2012
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.