Scope sample per second vs effective frequency? - Page 1
Forum section: electronics / beginners

author: kalel
author_rank: Frequent Contributor
timestamp: August 06, 2017, 01:43:33 am
content: Hi there,A post about a 10 MSps portable scope got me thinking about the effective frequency you can measure.I am still a complete noob when it comes understanding scopes (don't have one either).I'm not sure what the calculation is there. E.g. if we had 1 sample per second, and measured a 1 Hz signal, we wouldn't see too much (e.g. any overshoot, undershoot and such).Is there a simple way to calculate effective frequency you can measure based on MSps?

author: MK14
author_rank: Super Contributor
timestamp: August 06, 2017, 01:56:01 am
content: You really seem to be asking about basic Oscilloscope stuff. So here are some videos, to get you started:

author: kalel
author_rank: Frequent Contributor
timestamp: August 06, 2017, 02:58:49 am
content: Yes, basic indeed, still important to know. I will check the videos, the title of the third already seems quite appropriate.

author: MK14
author_rank: Super Contributor
timestamp: August 06, 2017, 03:01:18 am
content: Quote from: kalel on August 06, 2017, 02:58:49 amEverything really boils down to bandwidth. But even that statement is an oversimplification.Although something might be called a "Digital Oscilloscope", it is still really limited by things like analogue bandwidth (especially as regards the input stage, i.e. the front end) as well.Often/usually it is the analogue bandwidth which really matters (after that, you need a high enough digital sample rate, to usefully use that available analogue bandwidth). Without it, a super high digital sample rate will be mostly a waste of time.But digital sample rate DOES matter as well, don't get me wrong.It soon becomes an extremely complicated subject area. With all sorts of things making a significant difference, such as what probes you are using, etc etc.

author: rcowboy78
author_rank: Contributor
timestamp: August 06, 2017, 03:10:05 am
content: If I am understanding your question correctly, in order to replicate an analog signal in its entirety, you must take twice as many samples as that of the frequency.So for example if you have a 500 kHz sine wave, square wave, etc, you must sample at 1 MHz. See the Nyquist–Shannon sampling theorem.I'm not 100% sure if that is what your asking though.

author: MK14
author_rank: Super Contributor
timestamp: August 06, 2017, 03:18:56 am
content: Quote from: rcowboy78 on August 06, 2017, 03:10:05 amAs rule rule of thumb, scopes have a digital sample rate of about ten times the basic analogue front end bandwidth.So a 100 MHz bandwidth scope would have something like a 1000 million samples per second, sample rate.More is better, and less is still usable, but it would not give such a clear or accurate picture of what is going on.The Nyquist (see quoted post) is quite correct. But at it, you would NOT get a very good picture of what is going on, as there would only be about 2 samples per period.N.B. A 100 MHz scope, is only really good at displaying signal frequencies a fair bit lower than this frequency. So at 20 MHz and below, it would give quite an accurate view of what is going on. Above 20 MHz it would get increasingly attenuated (-3db point is at 100 MHz for a 100 MHz scope).

author: kalel
author_rank: Frequent Contributor
timestamp: August 06, 2017, 03:36:33 am
content: You are already giving great answers, and even including things like probe as a factor, which didn't come to mind.I was just wondering how to reasonably simply calculate the basic scope parameters needed, for example, to observe a 1 HZ oscillating signal. I'm sure that this will depend on the signal too, if it has a lot of noise, then a higher sample rate will be needed to display the noise.At 1 sample rate per second, I can only imagine "1 dot or point per second" being drawn, and an algorithm drawing lines between those points taken each second. So even for a 1 HZ oscillating signal, I imagine a lot more points would be needed to see it properly. But I assume here that 2 is the minimum to be able to measure it at all. Still, 2 wouldn't tell us much about the quality of the signal, especially if it's an imperfect oscillator, we might need 10, 100, 1000 points to see what's going on. For a perfect one, I guess we don't.I'm just wondering what a reasonable amount is. Unless you know what the signal looks like (how noisy it is and such) in advance, can you know how many points you need?

author: rcowboy78
author_rank: Contributor
timestamp: August 06, 2017, 03:44:21 am
content: I agree with you completely MK, however I don't know of any other way of explaining to the OP the reason why they have the sampling rates on the scopes that they do.For instance, you could have a square wave at 1 Hz and still sample it at 2 Hz and replicate the wave. However, if there is an anomaly in that 1 Hz that is greater then the required sampling rate, then you are not going to see it. In this case though, were not talking about a 1 Hz square wave any more also.I dunno, is there an industry standard among the scope manufactures that says it has to be X amount of samples for a specific time base?

author: MK14
author_rank: Super Contributor
timestamp: August 06, 2017, 03:45:39 am
content: At low frequencies, which you are specifically asking about. It is really easy.How many pixels is the screen width of the oscilloscope, let's say it is EXACTLY 1000 pixels.What timebase for a complete screen width. Let's say it is exactly 1 second (100 milliseconds per cm, screen = 10 cm).So (for the 1 Hz signal) you need a sample rate of 1000 samples per second, to fully fill in the screen as accurately as it allows (ignoring more complicated techniques, which can use even higher sample rates).But at higher frequencies, it is impracticable to use the above method, so fewer samples are used per screen width.E.g. A 100 MHz signal would then need 100,000,000,000 samples per second, which would either be extremely expensive or not currently technically possible, by that particular oscilloscope manufacturer.

author: kalel
author_rank: Frequent Contributor
timestamp: August 06, 2017, 04:07:20 am
content: Quote from: rcowboy78 on August 06, 2017, 03:44:21 amWell, you already did explain the basics. 2 points can describe a signal of 1 Hz, assuming it's a perfect signal. Otherwise, in real world, the more samples we can take, the closer the approximation of the signal is to the original. A noisy signal will have all kinds of details which can't be described with two points.I have no problem with this explanation (considering I got it right). I was just wondering about some reasonable values in real world applications. For example 2 samples per second is obviously not the reasonable value to measure a real 1 Hz oscillator, since it cannot produce a perfect signal.Quote from: MK14 on August 06, 2017, 03:45:39 amWell, I did take 1 to try and simplify calculations and understanding, but this should apply to other frequencies as a kind of ratio. Perhaps needed samples per second equals frequency being measured * 10, or * 100, or such. Surely a 1 Hz signal can be measured very well with any oscilloscope (as far as sample rate is concerned).Concerning the screen resolution, that is a perfectly good point. That's as many points as you can see. Although there is always zooming in-out, so having more than the screen width resolution should not hurt, unless it gives you some badly aliased appearance. But it probably uses some type of anti-aliasing to avoid that.

author: MK14
author_rank: Super Contributor
timestamp: August 06, 2017, 04:13:00 am
content: Quote from: rcowboy78 on August 06, 2017, 03:44:21 amThat is a good question.There are some industry level oscilloscope experts, who sometimes frequent this forum. So it might get answered.My earlier posts are partly contradictory, as regards sample rate, and how useful it is.To clarify.What I meant was that if the problem/issue is lack of front end analogue bandwidth.E.g. trying to see a 275 MHz signal, with a 50 MHz analogue front end, then no amount of extra digital sample rate, is going to really solve that problem for you.But if the analogue front end is good enough for the signal you want to see (e.g. 100MHz front end, 10 MHz signal), then a higher digital sample rate, can improve the results you get to see on the oscilloscope screen.Also multi channel oscilloscopes, vary as to if the maximum digital sample rate, is PER INDIVIDUAL CHANNEL or if it gets SHARED between the channels you are using.

author: MK14
author_rank: Super Contributor
timestamp: August 06, 2017, 04:20:19 am
content: Quote from: kalel on August 06, 2017, 04:07:20 amNot exactly.The 2 points will reliably pick up the FREQUENCY (assuming appropriate anti-aliasing), but not necessarily the accurate timing of the signals.In other words, you pull the device out of reset (a 555 timer say), and it outputs a 1 Hz signal. But how long was it after it first went out of reset, did the 1 Hz signal, first go high ?Was it 1 nano-second, 499 milliseconds, or whatever ?The 2 samples, wouldn't give you a very accurate timing diagram of the signals, versus the trigger point (which in this case, is probably the reset signal).

author: Mechatrommer
author_rank: Super Contributor
timestamp: August 06, 2017, 04:43:36 am
content: Quote from: MK14 on August 06, 2017, 03:18:56 amNyquist is correct, not "quite correct". its correctness is at the same level as Euclidean geometry or theory of relativity. its a master/phd thesis not some found by a guy back the yard. the problem with it is its a highly theoritical that conforming it in real life situation is difficult. for example try to build a perfect brickwall filter (bandwidth) that comply to the 1/2.Nyquist sampling criteria or infinite time sinc filter is next to impossible. the problem is with the implementation, not the theory. granted this theory is applied in real life situation, but with some level of compromise and "good enough" approximation. but by definition, if any even slightest freq element higher than nyquist sampling criteria, we are actually collecting garbage, by theory, but not that garbage, humanly speaking.

author: MK14
author_rank: Super Contributor
timestamp: August 06, 2017, 05:01:38 am
content: Quote from: Mechatrommer on August 06, 2017, 04:43:36 am"Quite correct" = Correct = What I said and meant."NOTquite correct" seems to be (to me), what youTHINKI said or meant.Example:Johnny what is 1 + 1 ?=2, "Yes, you arequite correct".But it could mean that there is aBUT, coming.E.g. What is 1 + 1 ?(***10 minutes later ......***)=2, "Yes, you arequite correct, BUT you took way way too long to answer".

author: MK14
author_rank: Super Contributor
timestamp: August 06, 2017, 05:24:52 am
content: EDIT2:The link seems to agree with what I have just been saying, which is that I said/meant it was 100%CORRECT.Quote-----------------------------------------------------------------------------------------------------------------------Apparently, it can actually mean partly/somewhat different things, between British English and American English.http://www.macmillandictionaryblog.com/the-trickiest-word-in-americanBy "Quite Correct", I meant 100% correct as regards the Nyquist bit, BUT I had concerns over the image quality, with so few (2) samples. Hence the need for a 'but'.tl;drI'm NOT 100% sure of the exact definition of "Quite right". Now that I know its definition can vary between the US and UK English, I'm even more confused by it.QuoteEDIT: Strictly speaking, the link above shows NO difference as regards UK/US, for the words I said. But it muddies the water, if you understand what I mean.

author: abraxa
author_rank: Frequent Contributor
timestamp: August 06, 2017, 08:41:31 am
content: Quote from: rcowboy78 on August 06, 2017, 03:44:21 amWhen sampling a 1 Hz square wave at 2 Hz, the only information you gain is the frequency. And even that may be incorrect as you may be sampling an aliased signal (http://hackaday.com/2017/03/23/say-it-with-me-aliasing/) without knowing. My main point however is that you can't tell what the waveform looks like. It it a sine? A quare wave? A sawtooth? Connecting the sampled dots would probably show a triangle wave. Using interpolation may show a sine wave. But in reality, it's a square wave!I'd like to link to two pictures so kalel understands:http://www.murata.com/~/media/webrenewal/products/emc/emifil/knowhow/basic/chapter02-p3/chapter02-p3_img0003.ashxOn the left side, each blue bar represents the frequency of a single sine wave and its intensity in the resulting signal. All frequencies exist in the signal at the same time (as shown in the center) and are added together (as shown on the right). What this means is that if you want to sample a 1 Hz square wave, you need to include some of the harmonics (n * signal frequency) in the measured signal. So in order to even realize that the signal is not a sine wave, you'd have to include the first harmonic of this particular signal - here, 3 Hz (n=3). According to Nyquist-Shannon, you however can't measure a 3 Hz sine wave when sampling at 2 Hz. You'll have to sample at 3 Hz at least.Certain signals contain virtually unlimited amounts of harmonics - the harmonics reduce in intensity with increasing n but they still add to the signal. So should we measure a 1 Hz square wave at 3 Hz, 300 Hz or 3 MHz?http://www.murata.com/~/media/webrenewal/products/emc/emifil/knowhow/basic/chapter02-p3/chapter02-p3_img0004.ashxAs this picture shows, the shape of the waveform hardly changes when including more and more of the harmonics - which means we can just cut them off at a certain point as we know "enough" about the waveform. That's where the next question of rcowbow78 comes into play:Quote from: rcowboy78 on August 06, 2017, 03:44:21 amAs far as I'm aware there is no industry standard but since a square wave has the highest requirements of any repetitive signal regarding the sampling of its harmonics, this is used as a reference signal. Depending on who you ask, a lot of people will want to see the 5th, 7th or 9th harmonics, rarely more. This means that for a sampling frequency of 1 GHz (for common scopes of today), you can measure a square wave of about 200 MHz (5th harmonics) or 140 MHz (7th harmonics) with enough detail to actually recognize it as such.Sure, it would be more accurate to include more harmonics, but that costs $$$ and may not be needed in the use case at hand. Also, my description is simplifying things of course, since the analog bandwidth of the scope plays a role - the harmonics are real frequencies which pass through the analog front-end of the scope, so even with a 1 GHz scope you won't be able to measure a 200 MHz square wave accurately if the front end has it's -3 db point at 50 MHz (and even if it's at 200 MHz).

author: Zero999
author_rank: Super Contributor
timestamp: August 06, 2017, 08:43:14 am
content: One reason why sampling at a much higher rate than the maximum frequency of interest, which I don't think has been mentioned in this thread (don't know about the videos, I haven't watched them yet) is phase and timing. Suppose you have two 1kHz sine waves, with one leading the other by 100µs. Sampling at 2kHz will not tell you that one waveform is leading the other by 100µs but increasing the sample rate to 200kHz will give you this information. Even if you only have one channel, the antialiasing filters required for the low sample rate, make it impossible to accurately trigger at specific parts of the waveform. This is why, you really need a much higher sample rate, than double the frequency of interest for non-repetitive waveforms.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 06, 2017, 09:38:16 am
content: If the waveforms are periodic, or more specifically, that they are repeating identically after some event that can be triggered on, then equivalent time sampling will reconstruct the signal just fine.Suppose you have a fast sample-and-hold, so that when the internal trigger pulse fires, the instantaneous* input value is sampled. This value is held for some time (microseconds, say), until it can be converted into a digital value by the ADC (which is much slower, MSps say).*The measurement cannot be perfectly instantaneous, that would be impossible. But it can be much faster than the ADC's sample rate. This is called, or related to, the analog bandwidth, or aperture window. Suppose you connect the input signal to a capacitor, using an electronic switch; when the switch opens, the capacitor retains the input voltage from the instant the switch opened. But if the switch has nonzero resistance, it won't follow the input perfectly, but will lag behind a little bit: this gives analog bandwidth. If the switch does not open perfectly fast either, it will "smear out" the input voltage over the time it takes to open: the aperture window.Now, suppose every time the input signal comes around, you set a delay, and then sample the input. And each time it comes around, you increase the delay by one sample time. Now you will reconstruct the waveform, at a fractional rate: equivalent time sampling!Real ET systems try to sample as fast as possible, not just once after each trigger. Suffice it to say, they figure out how to put the signal back together, however it was that the signal was taken apart. (For example, random sampling might trigger the sampler whenever, but when it does so, it reads a "time stamp" from a counter, which is timed relative to the trigger. The samples are then sorted by time stamp and read out as the waveform.)Tim

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 06, 2017, 10:03:07 am
content: And for the technical (or pedantic) side:If your signal is known to be a sine wave of some frequency, the minimum sample rate to construct it is... zero!A sine wave is perfectly stable for all time, so you only need two numbers to represent it: its  amplitude, and its frequency. (Okay, three if you say that a complex number is two real numbers. Or amplitude and phase.)So a sine wave needs no datarate.So that's not a sufficient condition on which to base the sampling theorem!The Nyquist theorem arises from the analysis of aband-limited signal of arbitrary values. That is, its spectrum is not known, aside from having a sharp cutoff within a given frequency range. The waveform might be periodic, in which case its harmonics extend up to the cutoff frequency only; or it might be aperiodic, like many real signals (like music, or random noise, or encoded data).A periodic, band-limited signal still only contains finitely many data: it's a finite series of sine waves. So it does not need many samples to represent it, and the rate is still zero. Only aperiodic waveforms require a data rate: a continuous stream of data. That said, if a waveform is periodic, but over a very long time -- that is, it contains a great many harmonics: it might not bepracticalto record the entire series, in which case it's aperiodic for practical purposes. This is where most real signals lie: a general purpose oscilloscope cannot make the assumption that its input is limited in this way, so it always samples at the maximum rate.And, what the sampling theorem says about signals like this, is simply that: if you sample this perfectly band-limited signal, at this minimum rate or higher, then the waveform can be perfectly reconstructed (with a similarly sharp filter following the sampler).Perfect reconstruction includes matching amplitude and phase properties. The filter might affect these, but the filter is a constant (a linear element). The key is that the sampling does not muck with phase and amplitude.What is sampling? Sampling is simply turning a waveform into a periodic series of samples: time discretization. It does not assume an ADC or DAC, though those are the most common examples in practice. (Note that digitizers also incur quantization noise, but this is related to the number of bits used. An ideal sampler would be real-valued and noiseless.)Note that the sampling theorem does not care about bandwidthfrom DC. It's simply bandwidth! If we want to sample a radio signal that's centered on a carrier frequency (that is, from Fc - BW/2 to Fc + BW/2), we can sample that at Fs >= 2*BW, regardless of what Fc is!Or if we sample relative to a time offset, rather than a frequency offset: we get equivalent time sampling. The bandwidth of ETS is limited in exactly the same way, but instead of one contiguous hunk of bandwidth, it's divided into harmonic slices. When these harmonics overlap the signal's harmonics, we are receiving exactly the information about the periodic (non-sinusoid) waveform: its harmonics and nothing else!Tim

author: hamster_nz
author_rank: Super Contributor
timestamp: August 06, 2017, 10:18:35 am
content: Quote from: MK14 on August 06, 2017, 04:20:19 amThis shouldn't irk me, but that is a complete fallacy and simply proven. Sample a 1 Hz sine signal at 2 Hz, perfectly in phase and you will get these results:Code:Sample #, Sample phase, value0 0 0.01 180 0.02 0 0.04 180 0.0Looks like a complete failure to me to detect any signal.... looks like you are missing half the information.

author: MK14
author_rank: Super Contributor
timestamp: August 06, 2017, 10:44:49 am
content: Quote from: hamster_nz on August 06, 2017, 10:18:35 amThat is a GOOD point!The following article, seems to agree with my answer. But your counter-example seems perfectly correct and reasonable.https://users.cs.cf.ac.uk/Dave.Marshall/Multimedia/node149.htmlAs I said in a much earlier post in this thread. It can easily become an extremely complicated subject area.tl;drI agree, there is a contradiction somewhereEDIT:I've researched this issue further. Remember I said that things can get VERY complicated.It seems that the Sample Rate = 2 X Maximum Frequency, is the absolute bare minimum, and is only borderline suppose to work. As well as anti-aliasing, it is needed to make sure that you are NOT at or too near the zero-crossing point of the waveform. Then it should work as expected.In practice, because you should be well above this "bare minimum", you shouldn't have this issue.But really you want to keep well above the 2 X Max Freq Nyquist. Which I (and others) have already said in other posts in this thread.EDIT2:On reflection, even the zero-crossing avoidance is probably NOT enough. As you would then just get a pile of samples at the same voltage. So we are still waiting for the magic Electronics mega guru, to quickly appear and explain away this phenomena . . .It is enough information (samples) to say that it is either exactly 1 Hz or a fixed DC voltage. If the DC is blocked (AC input coupling mode on scope), then it would work. But it seems unsatisfactory, because allowing DC, seems perfectly reasonable.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 06, 2017, 11:55:40 am
content: Quote from: blueskull on August 06, 2017, 10:13:36 amYeah. So, dealing with non-band-limited signals:If the signal has energy at frequencies above Fs/2, you cannot reconstruct it exactly: there is ambiguity at Fs/2 (as just mentioned above: if the sample clock is out of phase, it will read zeroes!), and higher frequencies are aliased to lower frequencies.We solve the reconstruction problem by making a compromise: we will not reconstruct the signal exactly, but reconstruct a band limited representation of it.This is inherent in ALL instrumentation, by the way. This is general: not just for sampling systems. An analog scope does not view the signal exactly, but only a bandlimited version of it. This is very important to keep in mind:what you see is not what you have!If you see a blip on a waveform, how can you tell if that's the entirety of the waveform, or if there's more blippiness on that blip? You can't. You can only repeat the measurement with a higher bandwidth instrument, if you have access to one. Always assume that there's more to the waveform than what you can see!(One can make similar observations about swept spectrum analyzers. Because the instrument itself is a Fourier transform, instead of missing frequencies, it's missing times. This is why RSAs brag about their ability to resolve transients: that capability isidenticalto a DSO's real time sample rate!)If we consider higher (out-of-band) frequencies to be noise or interference, then we should filter them such that they are attenuated down to the noise floor within the passband. If the passband is F, we must sample at least Fs = 2F, but that requires an ideal (brick wall) filter. Real filters have finite order, a slope rather than a hard cutoff. For a given slope, we need to go from 0dB (passband) at F, to (noise floor) dB at (Fs - F).For an 8-bit ADC (typical of o-scopes), the noise floor is around -50dB. We can choose any filter order we like, but a low-order filter will need quite a high sample rate to avoid aliasing.Related note: if you have excess sample rate, you can quite happily use a low-order filter. Microcontrollers polling input keys is such a case: HID bandwidth is in the <100Hz range, while GPIOs can trivially be polled in the 10s kHz. Switch debounce and EMI filtering can be done with a mere RC filter! To read the input, use a modest digital filter (i.e., sum up a sliding window of input samples), then apply a hysteresis threshold to the result. Also, if you think that doesn't count, because the inputs are digital?... Nope, works perfectly fine: digital inputs are (by definition!) 1-bit ADCs. The quantization noise is terrible, but an ADC is an ADC!It would be nice to use a high-order filter, but that has practical problems. You need a large diversity of different parts values (whether it's an active or passive filter), the values are very particular (i.e., the response is sensitive to changes in component values), and (for active filters) you may have dynamic range issues or even added noise (because each stage adds another amplifier to the chain, and the high-Q stages require high GBW and can develop relatively high voltages, making them more likely to clip).So you wouldn't normally choose a filter above maybe 10th order. That would be kind of extreme.Different filter types have different responses, again, as blueskull talked about above. A linear-phase filter (Bessel or equiripple group delay) is desirable for oscilloscopes, so that the time-domain waveform is preserved. A Butterworth filter is desirable for spectrum analyzers, because it has the least amplitude error. A Gaussian filter is desirable for both (because the Fourier transform of a Gaussian pulse or envelope is a Gaussian envelope or pulse, respectively: the technical term for this is an eigenfunction, that the transform of the function is the same function, give or take width and height). A Chebyshev filter is desirable for audio and radio, because the amplitude error is modest and the cutoff is as sharp as possible (perhaps saving cost).For all these examples, the sharpness of cutoff trades off with the phase or delay distortion. A Bessel filter has a rather wide transition band.To satisfy the -50dB noise floor from earlier, if we use a 5th order Bessel, we have -100dB/dec asymptotic response. The asymptote doesn't drop straight from the -3dB point, because of its soft transition band. However, assuming it did, we would need 1/2 of a decade, or 3.16*F, to get that attenuation. We would then have to set (Fs - F) = 3.16*F, or Fs = 4.16*F. For a 100MHz scope, that's a sample rate of 416MHz. (Because of the soft cutoff, the real figure might be 6*F or something.)Most scopes go for Fs = 10*F, perhaps because they're using even softer filters than this, maybe 4th or 3rd order. They may also set the cutoff frequency higher than spec (say, 150 or 200MHz for a 100MHz scope), so that the passband can be flatter, -1 or -2dB at the rated frequency.(The juiciest part about DSOs is, they can -- and probably do, and probablyshould-- filter the digital samples. Since we're acquiring an extra 3.16*F more bandwidth than we need, we can digitally filter that away, giving a lower noise signal. On the upside, because the excess bandwidth is quite generous, a quite simple filter, like a sliding-average or integer valued (1,2,1 or 1,3,3,1) FIR filter can do the job, without adding much hardware to the system. Presumably, one could remove this filter -- on suitably hackable DSOs, the ones with FPGAs driving the ADCs -- and "overclock" the input bandwidth a bit. The added bandwidth will include some aliasing, but one should remember, aliasing is often desirable for oscilloscopes, because equivalent time sampling is useful and because the signal is simply a time domain sequence of samples. One could also inspect the analog front-end and see if there's a filter that could be modified to similar ends.)Tim

author: Mechatrommer
author_rank: Super Contributor
timestamp: August 06, 2017, 12:46:52 pm
content: Quote from: hamster_nz on August 06, 2017, 10:18:35 amretry at 2.1 or 2.01 or 2.0001 points per cycle (and dont forget to use infinitity sinc function) ... BW < Fs/2...https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem"Critical frequency"

author: alm
author_rank: Super Contributor
timestamp: August 06, 2017, 01:01:49 pm
content: The Nyquist-Shannon sampling theorem is correct, if applied correctly. Like < FS/2 vs <= FS/2, and a true bandwidth-limited signal. If you do not meet these conditions, then things start breaking down. But that is your application of the theorem, not the theorem itself.This Keysight appnotediscusses sampling rates and bandwidth as it applies to oscilloscopes including graphs and practical examples.

author: rcowboy78
author_rank: Contributor
timestamp: August 06, 2017, 02:22:34 pm
content: Nice paper alm, that answers the question.Thanks.

author: hamster_nz
author_rank: Super Contributor
timestamp: August 06, 2017, 02:30:49 pm
content: Quote from: MK14 on August 06, 2017, 10:44:49 amHere is how I look at it. Say we were sampling a bandwidth limited periodic signal at 15Hz, with a trigger point of 0.0 and got the following 15 values:Code:-0.70-0.60-0.50-0.40-0.30-0.20-0.100.000.100.200.300.400.500.600.70According to the theorem (when used off the cuff) you should have all the information you need to deduce the amplitude and frequency of the signal being sampled, as the frequency is definitely much less than Fs/2. However, the best that can be done is do some math, and come back with "well, I know the amplitude is going to be more than X, and the frequency is going to be less than Y Hz".I'm sure you agree that you don't have enough information to say much more than that - as it is just not sampling slow enough to get enough information. We could know more about this signal if we had access to 15 samples, just spaced further apart in time.The same thing holds at high frequencies. If we were to get this 15 samples (note how these are the same values as above, but with every other sign swapped):Code:-0.700.60-0.500.40-0.300.20-0.100.000.10-0.200.30-0.400.50-0.600.70Then the best I can say is "Well, we have a high frequency signal, with an amplitude higher than X and the frequency is going to be greater than (15/2 - Y) Hz (with exactly the same X and Y values as in the low frequency example) - and have to say this because we are not sampling fast enough, or long enough, to get any more certainty about this signal.I guess the upshot is that sampling at X samples per second, bandwidth of 0 Hz to X/2 Hz is the limit when you have access to an infinite series of samples. When you only have a limited number of samples, the actual bandwidth will always be a tad smaller, both at the DC end, and at the Fs/2 end.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 06, 2017, 03:58:41 pm
content: Quote from: hamster_nz on August 06, 2017, 02:30:49 pmWhat's insufficient about this information?You have 15 samples of a bandlimited signal (not specified, but presumably meaning the limit making the theorem applicable). The signal only exists for 15 samples, as far as anything matters. And you can exactly reconstruct it (sinc interpolation).Is the signal periodic? Arbitrary? Who knows. That doesn't matter. The signal simply is what it is, within the window shown!QuoteHere, again, as long as the theorem is applicable, then the original signal can be reconstructed exactly. What's not to like?QuoteTo a finite time series, one uses the DFT, and gets a similarly discretized frequency series as the result. The "bins" evenly divide the range from 0 to Fs/2 (then back again, as the Fs/2 to Fs half is Hermitian with the first half -- for the most commonly used DFT matrix). If you are referring to the ambiguity of frequency, that a bin has a center frequency, not a range of frequencies, that's merely semantics: an arbitrary input frequency will be placed into several adjacent bins, with the distribution determined by the windowing function used. With an uncertainty of Fs/2N, it's notmeaningfulto speak of errors of frequency within a band.Tim

author: tggzzz
author_rank: Super Contributor
timestamp: August 06, 2017, 07:54:21 pm
content: You would benefit from reading application notes from HP/Agilent/Keysight and Tektronix. They have many which explain the basics of scope theory and practice.To stimulate your thought, I have a Tektronix 1502 which contains a sampling scope. I can see a <100ps risetime, so the bandwidth is in excess of 3GHz. From memory, the sampling rate is around 35kS/s. Of course the signal being sampled has to be repetitive.Key terms: real time sampling, equivalent time sampling.

author: alm
author_rank: Super Contributor
timestamp: August 06, 2017, 08:08:55 pm
content: The classic Tektronix appnoteXYZs of oscilloscopescontains a fair amount of information about sampling and interpolation starting on page 23.

author: tooki
author_rank: Super Contributor
timestamp: August 06, 2017, 08:29:56 pm
content: Quote from: hamster_nz on August 06, 2017, 02:30:49 pmDigital sampling doesn't work the way 99% of people think it does.You say that as we approach Nyquist, we can't have "any more certainty about this signal" -- well, yes, we can. If the signal is band limited as required, then those samples necessarily produce the desired signal, and only the desired signal. This video explains it better than anything else I've ever seen:https://youtu.be/cIQ9IXSUzuM

author: hamster_nz
author_rank: Super Contributor
timestamp: August 06, 2017, 09:33:55 pm
content: Quote from: T3sl4co1l on August 06, 2017, 03:58:41 pmSo, here are three different sine signals, at close to zero Hz, but with vastly different frequencies at three vastly different amplitudes. I've calculated them both at 15 samples per second, two two decimal places:Code:t 0.0005Hz*150 0.05Hz*15 0.05Hz*1.5-0.466667 -0.22 -0.22 -0.22-0.400000 -0.19 -0.19 -0.19-0.333333 -0.16 -0.16 -0.16-0.266667 -0.13 -0.13 -0.13-0.200000 -0.09 -0.09 -0.09-0.133333 -0.06 -0.06 -0.06-0.066667 -0.03 -0.03 -0.030.000000 0.00 0.00 0.000.066667 0.03 0.03 0.030.133333 0.06 0.06 0.060.200000 0.09 0.09 0.090.266667 0.13 0.13 0.130.333333 0.16 0.16 0.160.400000 0.19 0.19 0.190.466667 0.22 0.22 0.22Formulas were=SIN(2*PI()*B2/2000)*150=SIN(2*PI()*B2/200)*15=SIN(2*PI()*B2/20)*1.5So with 15 samples, at 15 Hz we have enough information to reconstruct the signal during the time we have sampled, but we don't have enough information to tell the difference between these three signals, even though they have orders of magnitude differences in frequency and amplitude (and an infinity of other options that would generate the same numbers). The same effect is visible at high frequencies, close to Fs/2.edit: added formulas to table

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 07, 2017, 06:15:54 am
content: Quote from: hamster_nz on August 06, 2017, 09:33:55 pmWell, that's because the signalsare identicalover the given domain, sample rate and accuracy. Why are you saying they're not?The original functions are lost upon sampling. There is no continuity between samples, all derivatives are gone. Indeed, that's one application of sampling: to bring the freakishly massive domain of real analytical functions down to a simpler vector domain.The function could also be a ramp, or similarly magnified section of any curve (not just a sinusoid). Indeed, an infinite number of real-valued continuous functions can be sampled to give that sequence. We can even construct new ones from the series that bear little similarity to the apparent pattern of samples:https://en.wikipedia.org/wiki/Runge%27s_phenomenon(Noting that such polynomials may not be band-limited anymore, but it's very likely that an interpolation procedure like this will produce some functions, if not all, that are band-limited within the domain.)And, even with an infinite series of samples, an unambiguous, real analytical function cannot be reconstructed. (This is because the samples are countably infinite, while the real domain is uncountable.) Only if the functions are band-limited, can they be reconstructed exactly (which is interesting, that would seem to say something about the size of the space of band-limited functions).Tim

author: IanMacdonald
author_rank: Frequent Contributor
timestamp: August 07, 2017, 12:22:53 pm
content: "N.B. A 100 MHz scope, is only really good at displaying signal frequencies a fair bit lower than this frequency."You might be surprised. Some analog scopes can display waveforms at 3x their rated frequency. The amplitude probably won't be accurate, but whether that matters depends on what you are doing of course.Other point is that this only applies to sinewaves or near-sinusoidal waves. Other waveforms contain harmonics which go to way higher frequencies. Remove the harmonics and you have no idea what the waveshape was. Thus a 100Mhz scope is only good for about a 10MHz squarewave. Or, maybe even less if you want sharp edges.

author: alm
author_rank: Super Contributor
timestamp: August 07, 2017, 12:32:59 pm
content: Frequency or bandwidth? Waveforms or sine waves? A 30 MHz signal may well have a bandwidth beyond 300 MHz (fast square wave). A 100 MHz square wave will look pretty terrible on a 100 MHz scope. That is where the old rules-of-thumb that the scope bandwidth should be something like 5x the signal frequency came from. A more modern way would be to just ignore frequency all together, and just look at bandwidth or rise time.How would you know if that 100 MHz signal is a slightly distorted sine wave or a square wave with a 100 MHz analog scope? What information do you get beyond what a frequency counter would give you if you do not know the shape or the amplitude?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 07, 2017, 04:17:17 pm
content: Quote from: alm on August 07, 2017, 12:32:59 pmNot everything in the lab need be quantitative.Example: I had an amplifier that was oscillating at 600MHz. My 350MHz DSO (TDS-460) is down probably 10dB up there, but it was still able to resolve it (and, importantly, was able to trigger on it, so it was visible in the first place).I've made similar observations with analog scopes as well, like a 200MHz Tek 475 (at some other frequency). There, the trigger sensitivity was noticeably poorer, but I was still able to read a stable waveform.EMI sniffing is a very qualitative operation. While it can be done with quantification in mind (using calibrated probes, and making careful note of probe location, distance, orientation and reading), it's mostly a matter of hunting around for suspicious waveforms. The amplitude response isn't very important; you're likely to see skewed waveforms, anyway, because of the nature of the sources and probes.Tim