Author Topic: Scope sample per second vs effective frequency?  (Read 9742 times)

0 Members and 1 Guest are viewing this topic.

Offline hamster_nz

  • Super Contributor
  • ***
  • Posts: 2803
  • Country: nz
Re: Scope sample per second vs effective frequency?
« Reply #25 on: August 06, 2017, 02:30:49 pm »
Well, you already did explain the basics. 2 points can describe a signal of 1 Hz, assuming it's a perfect signal.

Not exactly.
The 2 points will reliably pick up the FREQUENCY (assuming appropriate anti-aliasing), but not necessarily the accurate timing of the signals.


This 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: [Select]
Sample #, Sample phase, value
0       0               0.0
1       180             0.0
2       0               0.0
4       180             0.0

Looks like a complete failure to me to detect any signal.... looks like you are missing half the information.  >:D

That 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.html

As I said in a much earlier post in this thread. It can easily become an extremely complicated subject area.

tl;dr
I agree, there is a contradiction somewhere  :)

EDIT:
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 . . .  :-DD
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.
Here 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: [Select]
-0.70
-0.60
-0.50
-0.40
-0.30
-0.20
-0.10
0.00
0.10
0.20
0.30
0.40
0.50
0.60
0.70
According 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: [Select]
-0.70
0.60
-0.50
0.40
-0.30
0.20
-0.10
0.00
0.10
-0.20
0.30
-0.40
0.50
-0.60
0.70
Then 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.
« Last Edit: August 06, 2017, 02:55:05 pm by hamster_nz »
Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 
The following users thanked this post: MK14

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21609
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Scope sample per second vs effective frequency?
« Reply #26 on: August 06, 2017, 03:58:41 pm »
Here 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:

<snip>
According 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.

What'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!

Quote
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):
<snip>
Then 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.

Here, again, as long as the theorem is applicable, then the original signal can be reconstructed exactly.  What's not to like? ;D

Quote
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.

To 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 not meaningful to speak of errors of frequency within a band.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19281
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Scope sample per second vs effective frequency?
« Reply #27 on: August 06, 2017, 07:54:21 pm »
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.
« Last Edit: August 06, 2017, 07:56:18 pm by tggzzz »
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline alm

  • Super Contributor
  • ***
  • Posts: 2840
  • Country: 00
Re: Scope sample per second vs effective frequency?
« Reply #28 on: August 06, 2017, 08:08:55 pm »
The classic Tektronix appnote XYZs of oscilloscopes contains a fair amount of information about sampling and interpolation starting on page 23.

Offline tooki

  • Super Contributor
  • ***
  • Posts: 11341
  • Country: ch
Re: Scope sample per second vs effective frequency?
« Reply #29 on: August 06, 2017, 08:29:56 pm »
Here 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: [Select]
-0.70
-0.60
-0.50
-0.40
-0.30
-0.20
-0.10
0.00
0.10
0.20
0.30
0.40
0.50
0.60
0.70
According 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: [Select]
-0.70
0.60
-0.50
0.40
-0.30
0.20
-0.10
0.00
0.10
-0.20
0.30
-0.40
0.50
-0.60
0.70
Then 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.
Digital 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
 
The following users thanked this post: newbrain

Offline hamster_nz

  • Super Contributor
  • ***
  • Posts: 2803
  • Country: nz
Re: Scope sample per second vs effective frequency?
« Reply #30 on: August 06, 2017, 09:33:55 pm »
Here 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:

<snip>
According 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.

What's insufficient about this information?

So, 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: [Select]
    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.03
 0.000000      0.00      0.00      0.00
 0.066667      0.03      0.03      0.03
 0.133333      0.06      0.06      0.06
 0.200000      0.09      0.09      0.09
 0.266667      0.13      0.13      0.13
 0.333333      0.16      0.16      0.16
 0.400000      0.19      0.19      0.19
 0.466667      0.22      0.22      0.22

Formulas were
=SIN(2*PI()*B2/2000)*150
=SIN(2*PI()*B2/200)*15
=SIN(2*PI()*B2/20)*1.5

So 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
« Last Edit: August 06, 2017, 09:42:30 pm by hamster_nz »
Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21609
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Scope sample per second vs effective frequency?
« Reply #31 on: August 07, 2017, 06:15:54 am »
So, 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:

<snip>

So 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

Well, that's because the signals are identical over 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
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: newbrain

Offline IanMacdonald

  • Frequent Contributor
  • **
  • Posts: 943
  • Country: gb
    • IWR Consultancy
Re: Scope sample per second vs effective frequency?
« Reply #32 on: August 07, 2017, 12:22:53 pm »
"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.
« Last Edit: August 07, 2017, 12:32:03 pm by IanMacdonald »
 

Offline alm

  • Super Contributor
  • ***
  • Posts: 2840
  • Country: 00
Re: Scope sample per second vs effective frequency?
« Reply #33 on: August 07, 2017, 12:32:59 pm »
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?
 
The following users thanked this post: MK14, kalel

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21609
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Scope sample per second vs effective frequency?
« Reply #34 on: August 07, 2017, 04:17:17 pm »
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?

Not 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
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: MK14


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf