#65: Basics of using FFT on an oscilloscope

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
recently I was asked about using a modern digital oscilloscope and it's FFT or fast Fourier transform function to try to characterize the different tonal qualities of electromechanical devices and so I thought I'd do a little video on it it's kind of an interesting topic what are the advantages many advantages of modern digital scopes is that they've got the ability of doing some advanced math one of them is a Fourier transform which allows you to look at the frequency domain content of a signal a complex signal and this function goes back and do you know even that this nine or nine year old tech TDS 2014 has got an FFT function in it as well so they've been around quite a long time but the scope I'm going to use here is a more modern Tektronix 4000 series this happens to be an MD Oh 4100 4-6 but we're not going to use the spectrum analyzer input here because we're going to concentrate in this case on audio frequencies which is a below the minimum frequency for the spectrum analyzer so we're going to use an FFT function so before we do that let's do a quick little review of how scopes do the FFT and what that means so the oscilloscope essentially captures data over time by sampling it okay that's some sample rate and basically getting some data samples and capturing that over time so typically looking at voltage over time okay and basically that record of data is then processed with the fast Fourier transform to give you the frequency domain result so how does you know what you get in the frequency domain result relate to how this data was captured that's typically things that to confuse most people so let's see if we can kind of cover it pretty quickly here so again we're the scope samples data over time okay and how this how this how you set the scope up is going to determine what you get in the frequency domain and whose the the two major things one thing that people think about is okay what frequency range am I looking at on the output of the FFT the FFT is in the scope typically range from about DC out to 1/2 the sample rate okay so whatever sample rate was captured in this waveform and that may be the maximum sample rate of the scope or the scope may be set up so that the effective sample rate of this waveform is less than that but whatever that sample rate is okay that we're sampling data and in this captured waveform one half of that sample rate will be the highest frequency that you see out of the FFT so one of the things you want to do is set up the scope such that the sample rate being used for that waveform okay is going to give you essentially you know be sufficient to look at the highest frequency you want to look at in our case we're going to be looking at audio so I would say you know somewhere around 10 kilohertz as our maximum frequency here 10 12 killers would be fine so setting up the scope such that the effective sample rate on the waveform is you know 25 kilohertz it would be sufficient for audio okay so that's what we're going to do there now the other thing is what kind of resolution do you have okay how well can you resolve very closely spaced signals that's called frequency resolution on a spectrum analyzer okay it's typically the resolution bandwidth but an FFT it's typically kind of a bin spacing and what that resolution bandwidth what that bin spacing is that frequency resolution is is going to be related to the duration of the record that we've grabbed so how long of a record it will grab over time okay so for example if we captured this at you know say 10 milliseconds of division okay on the scope that would be say a hundred millisecond long duration okay so the frequency resolution is going to be related to that duration so the only other wrinkle in here is something called a window factor just doing a raw FFT on this data okay without doing any other processing on the data this window factor value would be one so essentially the frequency resolution will be one over the store asian that's kind of a good rule okay but typically FFTs will apply what's called a window function because an fft is kind of assuming that this sample of data that you're giving it is a representation of a continuous waveform okay and problem is that the waveform doesn't end at the same spot where it begins you get this discontinuity in the waveform and that leads to kind of distortions in the frequency domain so typically a window function is applied that multiplies this signal by an envelope so that it squishes to zero at the ends comes up and then squishes to zero at the other end okay and depending on there are different window functions that are very common and there's a couple selections in the scope to select those window functions will have a different window factor typically it's a number that's greater than one it might be one and a half one point eight two point two things like that but you can kind of get the idea that the frequency resolution is proportional to or inversely proportional to the duration the longer the duration the finer the frequency resolution so that's the way to think about that okay so we're not going to worry too much about what the actual window factor is that we're using okay but that's essentially what you'll get the other thing the vertical axis in FFT is typically shown log rhythmically because typically in FFT is going to show you a much wider dynamic range okay so instead of showing just a linear voltage most times the FFT will show you a DB VRMs okay as opposed to a linear voltage and you can change that on most of them as well but that's typically what you'd get so you get a DB voltage a DB of the RMS voltage vertically okay and frequency on the horizontal axis that ranges from DC to hack your sample rate and then the resolution that you get is inversely proportional to the amount of time to capture so given that let's set up the scope here to make some audio measurements okay so what we'll do first off is I'm going to just go and hit the default setup button here so that just kind of defaults the scope to so that there's nothing racki that's kind of left in the setup and you'll notice down here we can see the time per division two sample rate the number of points we're going to leave the number of points at ten thousand as I adjust my horizontal scale okay I'm going to changing the horizontal scale here we can actually see as I knock the horizontal scale down so get a larger value of time per division and see if I sample rates coming down right because I don't about I'm essentially capturing longer record of data so the sample rates of effective sample rate of the waveform is coming down so if we go down to something like say Oh 40 milliseconds of division okay my sample rate is 25 kilo samples per second and for this 10,000 points now that's actually pretty good because half of that is 12 and a half kilohertz so if I set up my my frequency span is going to go up to 12 F killer it's that's about the upper end of most adult hearing range okay and we're younger it's a little bit higher than that but the audio range we're going to worry about is probably about 12 and a half kilohertz that's probably good so we're going to leave ourselves at 40 milli second division and it gives me at 12 and a half kilo samples per second sample rate and the 12 and 1/2 K span on the FFT so the other thing I need to do is set up the vertical sensitivity to be able to pick up signals from my microphone and I'll talk about the microphone in a moment but just playing around with this I know I need to be at about 5 millivolts of division vertically here so we take a look there's my vertical scale I adjust that by just changing the knob here and you'll notice I'm going to knock that down to about 5 millivolts of division but we look at the scope I'm kind of move this waveform up a little bit we can actually see I've seen some noise here right because this scope has got a gigahertz a bandwidth well we're not going to use that full gigahertz of bandwidth I can I can go turn on channel 1 and tell it to apply a this case at 20 megahertz bandwidth limit filter and I cut the bit I cut the the noise down quite a bit but it's something else we can do as well remember this scope natively samples a 5 Giga sample per second so what we're doing is if we're only using essentially this case about 25 kilo samples per second so there's a lot of samples that are being sampled and just thrown away so rather throw them away we can put the scope into what's called high-res mode okay and we go to the horizontal acquire menu I push that button we can actually see the mood that the scope is in is sample okay let me just hit that sample button and in the selections that we have here are basically say what sample means is that it literally is that we're just going to take one sample at that sample rate and throw the rest away okay but what we can do is take advantage of this mood called high res by select high res okay I'll notice that my waveform got a lot thinner okay well are quieter what that's doing is it instead of throwing away all those other samples that we don't really need we're taking all of them as a group and averaging them together to create the one pill each point so you're essentially getting an institute averaging or boxcar averaging of the data so you get a little bit better effective number of bits and things like that so so now we've set up the analog channel appropriately to capture how this low-level audio signal so now what we need to do is turn on the FFT and the way we do that in the scope is we go to the math menu so I hit the math menu that brings up math down here along the bottom and if we look at the second button over that's the FFT so I'll select that okay and now over on the scope we can see there's my FFT I'm going to tell it I want to use channel 1 is my source that's fine I could see my vertical units or DB V so it's a DB of the RMS voltage here's this window things was look here there's actually some selections of window for Hanning rectangular Hamming etc rectangles like having the window at all these handing these other windows will cause the frequency resolution to get slightly coarser but Rorty you know down in the single-digit hertz of frequency resolution so I think we're just fine leaving it out to the default we can also see also now that the horizontal scale is 1.25 killers per division and that makes sense right we've said that we had a 12 and a half killer it's total span ten divisions so talk and 1/2 K divided by 10 is 1.25 killers per division so each division is going from DC to 1.25 gig or 1 point 2 5 kilohertz two-and-a-half killer at 7.50 etc etc so so there's our our frequency span so there's the FFT result of what we're looking at here so now we want to do is talk about getting the audio signal into scope channel 1 and we could use a microphone and that would work maybe we you know as long as the microphone is a type that doesn't need a bias and can just drive a resistive load like this 1 megaohm resistive load of the scope input but also something that's pretty easy to do and pretty common that is easy to find is you can simply use a like a little speaker here's a little 8 ohm speaker that I use for some my ham radio things a speaker will work just as well as a microphone as it does as a speaker okay so so I'm just going to take that and couple that right into the input to the scope here and you'll notice now that as I'm speaking you can actually see the waveform of my voice you can also see the spectrum of my voice here so we can actually see that going on so now we can actually make some measurements using that speaker as a microphone of some devices okay so just as a something to compare you know kind of an apples-to-apples thing is I've got two electric drills sitting over here okay and let's just look at the audio signature or the spectral signature of the audio of each of those so first one I'll grab here is this guy here this craftsman drill I've probably had four oh jeez 25 years or more it's been around a while a little bit then and both this drill and the other we're going to use our about the same loudness in terms of the volume but they do have a little bit different audio quality so if I run this drill by the speaker here just take a look at what our result is on the screen okay so I can see that that drill has got a lot of energy down at the lower frequency end not so much at the higher frequency end and we could have always pull it we can pull is the instrument you know save that waveform to a reference waveform so we can compare it to others but let's take a look now at another drill I have I've got this one's a newer drill here this is at the Walt okay this one's only about five or six years old okay and if I run this one here I'll take a look at the result and it was kind of clear from looking at that that I had a lot more energy up here even around you know five you know 5 kilohertz or so that didn't exist on the craftsman so you know the only point here is that this gives you a way of maybe quantifying you know where the the energy is at what frequencies ended and you might make a determination that one device sounds better than another sounds more pleasing than another one's more annoying to listen to and by making that judgment versus what you see in the spectrum for the audio of that thing you might be able to decide you know which one is more pleasing to use and that kind of a thing so anyway this is just a quick example of using an FFT and a modern oscilloscope how to set it up and get a good high resolution result here by using high-res mode how to get the enough capture depth or a capture length here in order to give you the frequency resolution you want and ensuring that the sample rate that gives you the frequency coverage that you want in the FFT results so anyway I hope you found this helpful useful and if you have any questions of course or any comments I'd love to hear about them and please leave them there on the YouTube channel and thanks again for watching
Info
Channel: w2aew
Views: 137,738
Rating: 4.9640126 out of 5
Keywords: W2AEW, Tek, Tektronix, Basics, Tutorial, FFT, fourier transform, scope, oscilloscope, audio, frequency, bin, resolution bandwidth, MDO4000, MDO4104-6, DPO, digital, RBW, resolution, fourier, spectrum, spectral, MDO
Id: oRf-IpG6XAw
Channel Id: undefined
Length: 14min 42sec (882 seconds)
Published: Thu Nov 08 2012
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.