Author Topic: is it true, oscilloscope must reach at least 4x observed freq?  (Read 12171 times)

0 Members and 1 Guest are viewing this topic.

Offline The Electrician

  • Frequent Contributor
  • **
  • Posts: 745
  • Country: us
Re: is it true, oscilloscope must reach at least 4x observed freq?
« Reply #25 on: September 13, 2022, 02:23:23 am »
You only need to sample at twice the bandwidth of the signal (or at one times the bandwidth for analytic sampling).

Completely false.

Imagine a sine wave that you're sampling at exactly 2x frequency.

a) You might sample the signal exactly on the peaks/troughs in which case you'll be fine.

b) OTOH you might sample it exactly on the zero-crossing points, in which case you'll see nothing at all.

You can also get every possible value in between (a) and (b), it's just dumb luck.

If you sample at 99.99999% of Nyquist you'll drift slowly between (a) and (b) and see the amplitude varying on screen ("AM effect").

2.5x Nyquist is the minimum to avoid this AM effect.

Modern statements of the sampling theorem are sometimes careful to explicitly state that x(t) must contain no sinusoidal component at exactly frequency B, or that B must be strictly less than ½ the sample rate.
 
The following users thanked this post: tooki

Offline Someone

  • Super Contributor
  • ***
  • Posts: 4585
  • Country: au
    • send complaints here
Re: is it true, oscilloscope must reach at least 4x observed freq?
« Reply #26 on: September 13, 2022, 02:33:56 am »
You only need to sample at twice the bandwidth of the signal (or at one times the bandwidth for analytic sampling).

Completely false.

Imagine a sine wave that you're sampling at exactly 2x frequency.

a) You might sample the signal exactly on the peaks/troughs in which case you'll be fine.

b) OTOH you might sample it exactly on the zero-crossing points, in which case you'll see nothing at all.

You can also get every possible value in between (a) and (b), it's just dumb luck.

If you sample at 99.99999% of Nyquist you'll drift slowly between (a) and (b) and see the amplitude varying on screen ("AM effect").

2.5x Nyquist is the minimum to avoid this AM effect.
Modern statements of the sampling theorem are sometimes careful to explicitly state that x(t) must contain no sinusoidal component at exactly frequency B, or that B must be strictly less than ½ the sample rate.
and to be more clear, 2.5x is a figure that provides some non-specific limit to that effect under typical band limiting/anitaliasing/reconstruction and does not ensure errors are avoided.

We dont have perfect sampling, or prefect band limited signals, or perfect reconstruction, and they all contribute (among other things) even in pure digital or simulation.
 
The following users thanked this post: balnazzar

Offline Fungus

  • Super Contributor
  • ***
  • Posts: 16763
  • Country: 00
Re: is it true, oscilloscope must reach at least 4x observed freq?
« Reply #27 on: September 13, 2022, 02:59:00 am »
and to be more clear, 2.5x is a figure that provides some non-specific limit to that effect under typical band limiting/anitaliasing/reconstruction and does not ensure errors are avoided.

I don't think you can get major distortions at 2.5x with a band-limited signal, but that's still an "if". How would you know?

Workaround: Use as few channels as possible on your DSO to keep the sample rate as high as possible. If in doubt, turn channels on/off to see if the signal of maximum interest changes shape.
« Last Edit: September 13, 2022, 03:00:52 am by Fungus »
 
The following users thanked this post: balnazzar

Offline Someone

  • Super Contributor
  • ***
  • Posts: 4585
  • Country: au
    • send complaints here
Re: is it true, oscilloscope must reach at least 4x observed freq?
« Reply #28 on: September 13, 2022, 03:15:08 am »
and to be more clear, 2.5x is a figure that provides some non-specific limit to that effect under typical band limiting/anitaliasing/reconstruction and does not ensure errors are avoided.
I don't think you can get major distortions at 2.5x with a band-limited signal, but that's still an "if". How would you know?
Because I do this stuff for a living... you can keep putting out non-specific/vague figures but they are just that, something which might be true in some non-specified situation.

There are easily found examples of 2.5x being inadequate.
 

Offline The Electrician

  • Frequent Contributor
  • **
  • Posts: 745
  • Country: us
Re: is it true, oscilloscope must reach at least 4x observed freq?
« Reply #29 on: September 13, 2022, 03:54:41 am »
and to be more clear, 2.5x is a figure that provides some non-specific limit to that effect under typical band limiting/anitaliasing/reconstruction and does not ensure errors are avoided.
I don't think you can get major distortions at 2.5x with a band-limited signal, but that's still an "if". How would you know?
Because I do this stuff for a living... you can keep putting out non-specific/vague figures but they are just that, something which might be true in some non-specified situation.

There are easily found examples of 2.5x being inadequate.

Please give us some examples where 2.5x is inadequate.  :)
 

Offline Fungus

  • Super Contributor
  • ***
  • Posts: 16763
  • Country: 00
Re: is it true, oscilloscope must reach at least 4x observed freq?
« Reply #30 on: September 13, 2022, 04:07:11 am »
There are easily found examples of 2.5x being inadequate.

Please educate us.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19779
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: is it true, oscilloscope must reach at least 4x observed freq?
« Reply #31 on: September 13, 2022, 07:57:49 am »
Bandwidth and sampling rate are completely independent.  The sampling rate must meet the Nyquist criteria to accurately reconstruct the waveform, but this has nothing to do with the bandwidth as defined by the -3dB amplitude response, which is why equivalent time sampling works.

As pointed out by tggzzz, a bandwidth limited signal can be reconstructed with a sampling rate greater than twice the bandwidth no matter where in the frequency spectrum it is, within the bandwidth of the sampler.  The sampling function itself is equivalent to RF mixing, and the circuits can be identical.  RF mixers make great microwave samplers when driven with a suitable pulse through their local oscillator port.  The sampling part of an analog-to-digital converter can be modeled as a down-conversion mixer.

Precisely.

A good practical example is the "Tayloe mixer" found in SDR receivers.

Those irritate me. 40 years ago  I built an 4kHz bandpass filter with a Q of ~4000 using 10% capacitors. It was based on the N-path filter concept I found in a 1950s BSTJ paper. The concepts were so counterintuitive that I had difficulty explaining them to analogue/RF engineers.

They continued to fascinate me, I felt sure they would be useful in other ways, but had no professional reason to use them. After retiring I was just gearing up to playing with them again, and found Tayloe had "beaten me to it". Rats.
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 Fungus

  • Super Contributor
  • ***
  • Posts: 16763
  • Country: 00
Re: is it true, oscilloscope must reach at least 4x observed freq?
« Reply #32 on: September 13, 2022, 10:41:11 am »
As pointed out by tggzzz, a bandwidth limited signal can be reconstructed with a sampling rate greater than twice the bandwidth no matter where in the frequency spectrum it is, within the bandwidth of the sampler.

In theory? Yes.

In practical terms? Not so much. The reconstruction filter would become very unwieldy as you approach Nyquist.

I do this stuff for a living... you can keep putting out non-specific/vague figures but they are just that

I don't do it for a living but I've played around enough with digital audio synthesis to have confirmed the "2.5x limit" experimentally.

ie. I've sat a potentiometer and manually dialed a frequency where I no longer observe the AM modulation effect mentioned earlier. The frequency I ended up with was right there in the 2.5x ballpark. Maybe it could have been 2.4x but it's definitely not as low as 2.2x.

2.5x may be a "non-specific/vague figure" but it works in practice.
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 27173
  • Country: nl
    • NCT Developments
Re: is it true, oscilloscope must reach at least 4x observed freq?
« Reply #33 on: September 13, 2022, 11:25:38 am »
You only need to sample at twice the bandwidth of the signal (or at one times the bandwidth for analytic sampling).

Completely false.

Imagine a sine wave that you're sampling at exactly 2x frequency.

a) You might sample the signal exactly on the peaks/troughs in which case you'll be fine.

b) OTOH you might sample it exactly on the zero-crossing points, in which case you'll see nothing at all.

You can also get every possible value in between (a) and (b), it's just dumb luck.

If you sample at 99.99999% of Nyquist you'll drift slowly between (a) and (b) and see the amplitude varying on screen ("AM effect").

2.5x Nyquist is the minimum to avoid this AM effect.
No. Coppice is right. Nyquist says that you'll have all the information in a signal up to fsample /2 (note: UP TO). You'll need lots of computational power to reconstruct the signal though in order to visualise it. Remember: an oscilloscope is there to visualise a signal. When the sampling is done the data in the buffer needs to be post-processed so the human brain can see and indentify the signal.

The factor 2.5 is just a convenient factor where an oscilloscope can use relatively simple sin x/x reconstruction and doesn't need an utterly steep anti-aliasing filter. If you throw in more computational power, you can get much closer to 2 and digitally correct for the steep anti-aliasing filter. But since the amplitude error will already be large near the bandwidth of an oscilloscope, it isn't worth the effort.
« Last Edit: September 13, 2022, 11:29:32 am by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline robert.rozee

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: nz
Re: is it true, oscilloscope must reach at least 4x observed freq?
« Reply #34 on: September 13, 2022, 11:38:08 am »
just for a laugh, why don't we bring in some empirical data? a novel approach, i must confess, but do humour me just for a moment.

980Hz (approx) square wave of about 8v p-p. sampled at various sampling rates...

2000 sps (2x frequency):



clearly this is a gross misrepresentation of the actual signal being measured! when data is scarce, a digital oscilloscope will default to showing a calming, un-contentious sine wave.


5000 sps (5x frequency):



this is just weird - the oscilloscope is getting seriously fooled by the input signal.


10,000 sps (10x frequency):



now we are starting to get there, although there is a whole load of waggling at top and bottom.


20,000 sps (20x frequency):



the 'evil' version of 10x.


50,000 sps (50x frequency):



starting to get there...


100,000 sps (100x frequency):



wow... at 100x (!) we have a pretty good representation of the original signal.


200,000 sps (200x frequency):



looks like the principal of diminishing returns has kicked in.


10M sps (10,000x frequency):



and this is what the scope chose when the "Auto Setup" button was pressed. looks like the scope manufacturer knows best - at least in this case!


cheers,
rob   :-)
« Last Edit: September 14, 2022, 01:55:59 am by robert.rozee »
 
The following users thanked this post: Someone, balnazzar, sx57

Offline Fungus

  • Super Contributor
  • ***
  • Posts: 16763
  • Country: 00
Re: is it true, oscilloscope must reach at least 4x observed freq?
« Reply #35 on: September 13, 2022, 11:49:26 am »
just for a laugh, why don't we bring in some empirical data? a novel approach, i must confess, but do humour me just for a moment.

980Hz signal (approx) of about 8v p-p. sampled at various sampling rates:

That's not a 980Hz signal.

That's a 980Hz signal plus a 2940Hz signal plus a 4900Hz signal plus a 6860Hz signal plus ... etc.

The whole "Nyquist" thing only works when the signal is bandwidth limited.

Ref: https://en.wikipedia.org/wiki/Square_wave
 
The following users thanked this post: sx57

Offline robert.rozee

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: nz
Re: is it true, oscilloscope must reach at least 4x observed freq?
« Reply #36 on: September 13, 2022, 12:01:13 pm »
That's not a 980Hz signal.
That's a 980Hz signal plus a 2940Hz signal plus a 4900Hz signal plus a 6860Hz signal plus ... etc.
The whole "Nyquist" thing only works when the signal is bandwidth limited.
Ref: https://en.wikipedia.org/wiki/Square_wave

piffle!   :scared:

it is a 980Hz square wave, and a perfectly acceptable example of what an oscilloscope is used for measuring. if the only thing you are going to measure is sine waves, then why even bother with an oscilloscope? get a frequency counter and RF voltmeter instead    :palm:


cheers,
rob    :-DD
 

Offline Fungus

  • Super Contributor
  • ***
  • Posts: 16763
  • Country: 00
Re: is it true, oscilloscope must reach at least 4x observed freq?
« Reply #37 on: September 13, 2022, 12:17:41 pm »
it is a 980Hz square wave, and a perfectly acceptable example of what an oscilloscope is used for measuring.

Sure, but as you demonstrated so visually: It's not something you can sample and reconstruct with a 2kHz sampling system.

Because... it's a 980Hz sine wave plus a 2940Hz sine wave plus a 4900Hz sine wave plus a 6860Hz sine wave ... to infinity.

« Last Edit: September 13, 2022, 12:41:21 pm by Fungus »
 

Offline robert.rozee

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: nz
Re: is it true, oscilloscope must reach at least 4x observed freq?
« Reply #38 on: September 13, 2022, 12:38:12 pm »
... to infinity.

the device generating the square wave did not make use of an form of infinity, either theoretical or actual.

now a square wave can be represented by an infinite sum of sine waves, but it is not made out of them. it is made with just a little fellow switching a light switch: on... off... on... off... on... off... very fast.

the infinite sum of sine waves you talk about only exists in one's imagination.


cheers,
rob   :-)
 

Offline Fungus

  • Super Contributor
  • ***
  • Posts: 16763
  • Country: 00
Re: is it true, oscilloscope must reach at least 4x observed freq?
« Reply #39 on: September 13, 2022, 12:58:10 pm »
the infinite sum of sine waves you talk about only exists in one's imagination.

Fun fact: Your ears can't tell the difference between a 10kHz square wave, a 10kHz sawtooth wave and a 10kHz sine wave. They all sound exactly the same!

 

Offline robert.rozee

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: nz
Re: is it true, oscilloscope must reach at least 4x observed freq?
« Reply #40 on: September 13, 2022, 01:03:28 pm »
Fun fact: Your ears can't tell the difference between a 10kHz square wave, a 10kHz sawtooth wave and a 10kHz sine wave. They all sound exactly the same!

i think your ears might need checking...


cheers,
rob   :-)
 
The following users thanked this post: george.b

Offline wasedadoc

  • Super Contributor
  • ***
  • Posts: 1440
  • Country: gb
Re: is it true, oscilloscope must reach at least 4x observed freq?
« Reply #41 on: September 13, 2022, 01:05:53 pm »
... to infinity.

the device generating the square wave did not make use of an form of infinity, either theoretical or actual.

now a square wave can be represented by an infinite sum of sine waves, but it is not made out of them. it is made with just a little fellow switching a light switch: on... off... on... off... on... off... very fast.

the infinite sum of sine waves you talk about only exists in one's imagination.


cheers,
rob   :-)
A perfect square wave can be represented by that infinite sum.  In practice no generator can make a waveform that has zero risetime.  It may be close enough to zero to make no engineering difference in the situation under examination but the risetime will be non-zero and in the frequency domain that corresponds to no harmonics above some point.
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 27173
  • Country: nl
    • NCT Developments
Re: is it true, oscilloscope must reach at least 4x observed freq?
« Reply #42 on: September 13, 2022, 01:27:19 pm »
No. Google 'Gibbs phenomenon'
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline switchabl

  • Frequent Contributor
  • **
  • Posts: 445
  • Country: de
Re: is it true, oscilloscope must reach at least 4x observed freq?
« Reply #43 on: September 13, 2022, 01:30:16 pm »
Imagine a sine wave that you're sampling at exactly 2x frequency.

a) You might sample the signal exactly on the peaks/troughs in which case you'll be fine.

b) OTOH you might sample it exactly on the zero-crossing points, in which case you'll see nothing at all.

You can also get every possible value in between (a) and (b), it's just dumb luck.

If you sample at 99.99999% of Nyquist you'll drift slowly between (a) and (b) and see the amplitude varying on screen ("AM effect").

2.5x Nyquist is the minimum to avoid this AM effect.

The familiar version of the sampling theorem as published by Shannon is his seminal 1948 and 1949 papers assumes a function f that "contains no frequencies higher than W cps". At first sight this might seem to include your counter-example (sine at frequency W), however Shannon is writing for engineers, not mathematicians, so he glosses over some details. The proof has an implicit assumption that f is square-integrable which in fact excludes signals containing any pure sines. Note that there are ways to generalize this using more advanced mathematical machinery but you may or may not be content to just claim that there are no pure sines in the real world anyway.

On the practical side, it is also important to realize that the sampling theorem is inherently infinite time. It assumes that you have sampled the signal for an infinite duration. If you take a finite portion of a band-limited signal you are effectively applying a window function and thereby broadening the spectrum beyond its original bandwidth.¹ Together with any sampling jitter this will give you a hard limit that is higher than 2x but probably not by much.

More importantly, the sampling theorem also assumes you are using all the samples for reconstruction all the time but you probably aren't because a) it would use a lot of processing power and b) it doesn't work for real-time applications (the ideal sinc-filter is non-causal and has infinite delay). Depending on the number of taps you use, frequencies close to the Nyquist limit will still alias close to DC. This is what you observe. However, this is a trade-off and the limit of 2.5x is an arbitrary choice of the implementation you are using. You can get a lot closer to 2x if you use more than a couple of samples for interpolation.

¹ It will technically no longer be band-limited at all (you cannot have a signal that is both time- and band-limited).  But let's ignore that here, as long as it drops below our noise floor, we don't really care.
 
The following users thanked this post: Fgrir

Online mawyatt

  • Super Contributor
  • ***
  • Posts: 3403
  • Country: us
Re: is it true, oscilloscope must reach at least 4x observed freq?
« Reply #44 on: September 13, 2022, 01:44:36 pm »
Precisely.

A good practical example is the "Tayloe mixer" found in SDR receivers.

Those irritate me. 40 years ago  I built an 4kHz bandpass filter with a Q of ~4000 using 10% capacitors. It was based on the N-path filter concept I found in a 1950s BSTJ paper. The concepts were so counterintuitive that I had difficulty explaining them to analogue/RF engineers.

They continued to fascinate me, I felt sure they would be useful in other ways, but had no professional reason to use them. After retiring I was just gearing up to playing with them again, and found Tayloe had "beaten me to it". Rats.

Interesting, we employed the N-path filter concept back in ~1980 to pick out signaling "tones" displaced within multiple 4KHz bandwidth "sections" displaced at microwave frequencies, the filter had a bandwidth of 10Hz. These multiple (thousands) 4KHz sections were down-converted using Nyquist as our "friend" rather enemy, employing Microwave RF Downconversion by means of Nyquist sub-sampling where we knew exactly where each multiple displaced 4KHz section would be and where the tones should be.

So in a way Nyquist can be helpful but not in the DSO discussions here!!

It's amazing that it took another ~35 years to discover the N-Path Mixer, or Polyphase Mixer, which is fundamentally the N-Path Filter without the up-conversion back end section :o

Best,
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Offline BillyO

  • Super Contributor
  • ***
  • Posts: 1508
  • Country: ca
Re: is it true, oscilloscope must reach at least 4x observed freq?
« Reply #45 on: September 13, 2022, 01:57:39 pm »
I wonder if the OPs question is well answered here?  I would be good if he could return and try to answer the outstanding issues with his first question.

He may not know the difference between BW and SR.

Bill  (Currently a Siglent fanboy)
--------------------------------------------------
Want to see an old guy fumble around re-learning a career left 40 years ago?  Well, look no further .. https://www.youtube.com/@uni-byte
 
The following users thanked this post: Someone

Offline switchabl

  • Frequent Contributor
  • **
  • Posts: 445
  • Country: de
Re: is it true, oscilloscope must reach at least 4x observed freq?
« Reply #46 on: September 13, 2022, 02:08:52 pm »
just for a laugh, why don't we bring in some empirical data? a novel approach, i must confess, but do humour me just for a moment.

980Hz (approx) square wave of about 8v p-p. sampled at various sampling rates:

This may be a nice illustration of Gibb's phenomenon but it is fortunately not what happens if you sample with a properly matched anti-aliasing filter. It is what happens if you just ignore the Nyquist criterion. And then apply sinc-based interpolation anyway. Did you have to turn that on manually or is that actually the default? If so, that would seem to be either a bug or a strange design choice indeed.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19779
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: is it true, oscilloscope must reach at least 4x observed freq?
« Reply #47 on: September 13, 2022, 02:15:17 pm »
Precisely.

A good practical example is the "Tayloe mixer" found in SDR receivers.

Those irritate me. 40 years ago  I built an 4kHz bandpass filter with a Q of ~4000 using 10% capacitors. It was based on the N-path filter concept I found in a 1950s BSTJ paper. The concepts were so counterintuitive that I had difficulty explaining them to analogue/RF engineers.

They continued to fascinate me, I felt sure they would be useful in other ways, but had no professional reason to use them. After retiring I was just gearing up to playing with them again, and found Tayloe had "beaten me to it". Rats.

Interesting, we employed the N-path filter concept back in ~1980 to pick out signaling "tones" displaced within multiple 4KHz bandwidth "sections" displaced at microwave frequencies, the filter had a bandwidth of 10Hz. These multiple (thousands) 4KHz sections were down-converted using Nyquist as our "friend" rather enemy, employing Microwave RF Downconversion by means of Nyquist sub-sampling where we knew exactly where each multiple displaced 4KHz section would be and where the tones should be.

So in a way Nyquist can be helpful but not in the DSO discussions here!!

It's amazing that it took another ~35 years to discover the N-Path Mixer, or Polyphase Mixer, which is fundamentally the N-Path Filter without the up-conversion back end section :o

Best,

Yes indeed. I'm irritated that I didn't have a chance to (re)invent the Tayloe mixer. I would have had a fighting chance if I'd been working in the right field. Oh well.

My use was simply to reduce thermal and environmental noise when using a large area BPW92 photodiode to measure the loss in early installed multi mode fbres. When asked why I didn't use a PLL, I said I couldn't predict how long it would take to lock up, which would have been a problem.

I still like to think I could find a use for ASP, I.e. analogue sampling/signal processing.
« Last Edit: February 16, 2023, 09:48:03 am 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
 
The following users thanked this post: Electro Fan

Offline Fungus

  • Super Contributor
  • ***
  • Posts: 16763
  • Country: 00
Re: is it true, oscilloscope must reach at least 4x observed freq?
« Reply #48 on: September 13, 2022, 02:50:26 pm »
i think your ears might need checking...

(Yoda voice)

So sure, you are.

PS: What you're saying is that you can hear 30kHz sine waves - square waves are the sum of sine waves.
 

Offline Fungus

  • Super Contributor
  • ***
  • Posts: 16763
  • Country: 00
Re: is it true, oscilloscope must reach at least 4x observed freq?
« Reply #49 on: September 13, 2022, 02:53:32 pm »
there are no pure sines in the real world anyway.

Sure there are. There's just a lot of harmonics mixed in so isolating them is difficult.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf