> temp > à-trier > eevblog-1213-oscilloscope-sinc-interpolation-convolution

EEVblog #1213 - The Oscilloscope Interpolation Trap!

EEVblog - 2019-05-21

Oscilloscope Sin X/x Interpolation can be a trap for young players, find out why.

Forum: http://www.eevblog.com/forum/blog/eevblog-1213-the-oscilloscope-interpolation-trap/

#Oscilloscope #Trap #Interpolation

Bitcoin Donations: 38y7DE8HEHNj8fGDtUr4PkCn9nWxiorvvy
Litecoin: ML7oQokTwB38bgzzjLDbRV97HKAHuwRfHA
Ethereum: 0x11AceA38DCA9DbFfB4F35f3F746af65F9dED28ce

EEVblog Main Web Site: http://www.eevblog.com
The 2nd EEVblog Channel: http://www.youtube.com/EEVblog2

Support the EEVblog through Patreon!
http://www.patreon.com/eevblog

AliExpress Affiliate: http://s.click.aliexpress.com/e/c2LRpe8g
Buy anything through that link and Dave gets a commission at no cost to you.

Stuff I recommend:
https://kit.com/EEVblog/

Donate With Bitcoin & Other Crypto Currencies!
https://www.eevblog.com/crypto-currency/

T-Shirts: http://teespring.com/stores/eevblog
Likecoin – Coins for Likes: https://likecoin.pro/@eevblog/dil9/hcq3

AstralStorm - 2019-05-21

Gotta know your sinc. Your scope at least has zero order hold ("disabled") I hope too, in addition to linear? (Bars instead of tiny dots. Or fat dots.)

One thing I'd love to see is ZOH with error bars from sinc ringing as estimate, like a blurry overlay. It's a rare case that your clock is perfectly synced with signal. Old analog scopes naturally did that with faded display due to capacitance in memory and display... Though that can lie too, it's exponential interpolation - Laplacian it's called I think?

Using a scope as a frequency counter over sample rate only works if you average enough samples. (Or take a long Fourier spectrum, similarly.) Not quite what you showed.

AstralStorm - 2019-05-21

@Piezoid The path under Fs/2 or rather its upper bound from unwindowed truncated sinc is about as useful as the voltage value at any of those points. Not useful at all unless you can read aliasing and intermodulation from a time domain view. I can but only in a few simple cases. Complex signals produce unintelligible non-local garbage when sinc interpolated, unless a few specific window functions are used. Often the scope does not say which window is in use - typical guess is Hamming.

Scope is a multipurpose tool and should have options for value, shape, onset, outset and frequency accuracy. Sinc may be the latter. It's no good for any other purpose.
Maybe even an extra digital signal mode to emulate a LSA.

PerfumedManatee - 2019-05-21

Samples should be drawn as lollipops (or similar):
https://youtu.be/cIQ9IXSUzuM?t=6m1s

AstralStorm - 2019-05-21

@PerfumedManatee Candlesticks (fat dots on a stick) are better still. Lollipops do not tell you about estimated overshot.

Matthijs van Duin - 2019-05-22

Am I right in assuming the scope will implicitly low-pass filter the signal to avoid aliasing? Since if so, sinc-based interpolation does have the distinct benefit that the line drawn is independent of how the sampling grid is aligned w.r.t. the signal.


In the end, every interpolation method will unavoidably be wrong for some signals, the most important thing to do would be to ensure the user is aware when he's zoomed in excessively. Maybe the line should be blurry or something.

AstralStorm - 2019-05-22

@Matthijs van Duin The scope might have an analog lowpass filter (including probe capacitance) or oversample and use a digital one.
The precise result and implementation of such lowpass near Fs/2 is often undocumented.

Mr.Kristian252 - 2019-05-21

This thumbnail got me

musashi939 - 2019-05-21

That's a penis!

Enrico Trudu - 2019-05-21

Maybe from a Diktronix scope

Alexander Bukh - 2019-05-21

16:27

3dlabs99 - 2019-05-21

It's a trap using the "it's a trap" reference

Tritemius Labs - 2019-05-21

The ringing BEFORE the signal is a screaming sign, that we see artefacts of digital signal processing.

Knoz - 2019-05-21

@unfa A real world normal first and second order low pass filter does not cause that because a real filter is causal and the largest phase difference possible is 90/180 degress, way insufficient for multy period pre ring. No ringing before the pulse arrives for simple real filters ! If you have a transmission line or some other thing with huge phase delay and dispersion, then you can probably generate this in analog too, in the sense that everything will be delayed multiple periods and therefore causal pre ringing is possible with the ringing delayed less than the bulk of the signal...
That signal theory stuff....yeah, i think an ideal lowpass would cause gibbs ringing of the sin(x)/x type, but an ideal filter is kinda bullshit. No such thing. Can probably be approximated and has some real world use, otherwise they would not teach it.
Digital signal processing throws it all outta the window. Fourier transform based fast convolution and similar stuff is usually not causal and generates all sort of hillariously comical signals that are totally impossible in reality, which is of no concern if you are processing a prerecorded signal where the future is known....

Tritemius Labs - 2019-05-21

The key point here is that in digital processing we can easily create something that looks like looking ahead to the future and as a result, the impulse response will be symmetrical along the time axis. In analogue circuitry, this is also possible, but it will cost a gigantic heap of samplу-and-hold capacitors or delay lines and other circuits.

Anon Ymous - 2019-05-22

The assumption hiding here is that the original signal was properly filtered before sampling to contain no energy above the Nyquist frequency. If that's so, sinc() interpolation is the law; it's physics and beyond individual preference; if it's not properly band-limited, artifacts rule the land at the high end of the bandwidth. Digital signal processing won't have "artefacts" if Nyquist is obeyed.

John Yang - 2019-12-04

@Knoz No. It's due to the linear phase. It's better.

John Yang - 2019-12-04

@Tritemius Labs It's not always. It's chosen to be linear phase using fir. They can certainly use minimum phase if no maximum phase if you want.

James Barclay - 2019-05-21

When the waveform looking pretty cute but it has a dong

Sebastien LICHT - 2019-05-21

NO ,
you have a DONK :
https://www.youtube.com/watch?v=ufDTDUPZrag

Amira Lozse - 2019-05-22

thats called a trans-signal

Andrew Hudson - 2019-05-21

Keep these scope vids going. I teach an electronics class at work to green engineers and you seem to explain things a lot better than I can.

Bruce Nitroxpro - 2019-05-21

If only we could supply the field with people like this, there would be a lot more digital scopes being used correctly.

Rýán Túçk - 2019-05-21

If only we could supply a confuser to all the peoples fields.

richb313 - 2019-05-23

I always explained to my techs you have to be smarter than your test equipment because if you are not they will lie to you with great regularity.

Simon Dalzell - 2019-05-21

It's the reverse of the problem audiophiles have! Some look at linearly-interpolared digital audio samples and assume they're getting a "blocky" audio output. Then they look at the sine interpolation and complain about those wiggles around a theoretical square wave and think that's an artifact of converting analog to digital. Great demonstration in an obvious place that I'd never considered.

Bruce Nitroxpro - 2019-05-21

@victornpb , Regardless of how right you are, an "audiophile" may not know their math and can't fully appreciate what you've said. But you're right on track.

TMM - 2019-05-21

​@victornpbA speaker acts as an RL lowpass filter due to the resistance and inductance of the voice coil. It's the RL filter that enables filter-less Class-D amplifiers (if you don't mind your speaker cables transmitting RF junk!). The mechanical suspension only has a significant effect at the resonance (low) frequency. A 1st order integrator or low pass filter like a speaker coil is not nearly as effective at anti-aliasing as a proper sin(x)/x interpolation. An ideal anti-aliasing filter needs to have no attenuation in the pass band and infinite attenuation above the nyquist frequency. The only practical way of achieving that is with a digital sin(x)/x filter also known as a 'brickwall filter. If you only partially attenuate frequencies above nyquist then you only get partial anti-aliasing.
What audio DACs effectively do is increase the sample rate from 44.1KSa/s to say 384KSa/s by duplicating samples, then they pass the 384KSa/s signal through a digital sin(x)/x i.e. brickwall filter which removes all frequency content above 22.05KHz (nyquist). This acts to smooth out the big 'stair steps' in the 44.1KSa/s signal to much smaller steps in a 384KSa/s signal. The signal is then output by a 384KSa/s DAC. Any artifacts (i.e. stairsteps) from the DAC are then easily anti-aliased by a relatively low-order analogue filter at ~30KHz (just above audio band), since the frequency content of the 'steps' is up at tens or hundreds of KHz where the simple audio filter produces a lot of attenuation. In reality, most audio DACs/ADCs are built on delta-sigma oversampling architecture and not sample-and-hold so the unwanted content produced by an audio DAC is high frequency delta-sigma noise rather than stairsteps, but they use the exact same procedure of oversampling, digital brickwall and simple audio-band analogue anti-aliasing filters.

ABaumstumpf - 2019-05-21

Audiophool - the people that also often claim they can hear the difference between 16bit 96 kHz and 24bit 192 kHz.
(and then they also buy some oh-so-great tube-amps with distortion higher than 1% -.- )

richb313 - 2019-05-23

@John Yang This is why nebulous terms like Presence are used when describing the loss of Digital Conversion to pure Analog Music like on Vinyl.

richb313 - 2019-05-23

@victornpb Which is why we have Impedance Matching and selected Out Put components with little or no correction needed. The mechanics and electrical properties are considered and designed for in high end amps.

Joubert Jasokie - 2019-05-21

AvE and Dave mashup = dAvE.

Do it!

Dave Rhodes - 2019-05-21

@Leo Curious
Several hundred thousand views per video? Perhaps you should stick to kids cartoons.

Upcycle Electronics - 2019-05-21

Not everyone watches YTbers that are so loose with the foul language. Some of us have kids around. I watched AVE in the past but I'm not interested unless he goes clean.

Joubert Jasokie - 2019-05-22

@Leo Curious Maybe we take you apart and see if your insides are skookum.

Joubert Jasokie - 2019-05-22

@Upcycle Electronics Better they learn it from that guy on youtube than on the streets from some wankers and gangbangers. Lol

666Tomato666 - 2019-05-22

@Upcycle Electronics yeah, shame you have to give out your first-born for a pair of headphones

kalhana1 - 2019-05-21

real trap for young players
newfangled
come-a-gutsa
chase a red herring down a rabbit hole

Leo Curious - 2019-05-21

Whats this other thing... sometimes when he doesnt know he says "bjurla, bjurla" or whatever? How to google something like that? ;D

dentakuweb - 2019-05-21

@Leo Curious He's saying Bueller. It's a reference to Ferris Bueller's Day Off. https://www.imdb.com/title/tt0091042/

Upcycle Electronics - 2019-05-21

Thanks. Because you spelled it out, I finally looked up:
come-a-gutsa (UrbanDictionary)
"Verb. (Australian colloquialism) To be thrown off a moving object at high speed, arms and legs flailing, landing on a hard surface and sustaining multiple wounds and broken bones."

This is the only one he says that I just totally ignored...for the last 4+ years I've been watching...Funny, the injury that disabled me and got me into hobby electronics fits the definition perfectly.

Drakkar Calethiel - 2019-05-21

Confusor, AvE must have infected you. :D

Eo Tunun - 2019-05-21

Wait for the next time AvE turns some harbour freight tool upside down, then discuss how all the electrons are falling out… ^^)
Next step will be identifying the magic smoke as "The Schmoo (©)"

Denny - 2019-05-21

@Eo Tunun Pixies and Schmoo!

Eo Tunun - 2019-05-21

@Denny Wait for the Cockford-Ollie multimetres! :oD

SAI Peregrinus - 2019-05-21

I wouldn't call sinc "smoke and mirrors". The Nyquist-Shannon sampling theorem derivation requires convolution of the sampled values with an ideal sinc function to recover the original signal. The reason for the 4x instead of the 2x limit is because of the finite number of samples and the finite (non-ideal) sinc function used. Just as the Fourier transform is only valid for infinitely repeating signals so real systems use windowing functions which add some distortion. It's important to know what the differences from the ideal case are to interpret any measurement.

John Yang - 2019-05-21

@Hyxtryx If the filtering is not steep enough there will be frequency inverted signal going into audible range. But that would be too stupid to design such design. And the phase shift due to filter may cause audible difference. Science haven't shown which type of filter is the best but it's there.
And the bit depth of the sampling will affect the Nyquist theory. So it will not be ideal. So better bit depth, higher sampling rate, more gradual filter will be the best way to reproduce audio signal.

Keith Yip - 2019-05-21

Sinc is not the problem. Using linear interpolation won't save you. It gives a far off result when a sampling rate is insufficient and a signal contains high frequency too, just a different kind of wrong result comparing to sinc.

MrJef06 - 2019-05-21

"The reason for the 4x instead of the 2x limit is because of the finite number of samples and the finite (non-ideal) sinc function used."
Thanks for this, exactly the info I was looking for. I was like "What? Nyquist OK, sinc used, then why the poor reconstruction?"

Boyd Waters - 2019-05-22

Creates high-frequency ringing, you filter out anything higher than 20 kHz. So yes, higher sample rate could push your distortion beyond 40kHz, but honestly past 16kHz is basically not audible.

Original CD spec is sufficient for stereo audio reproduction. When recorded properly, using the 24 bits of dynamic (loudness) range and the 44.1 kHz bandwidth, it sounds just fine.

Vaes Joren - 2019-05-26

The advantage of significantly higher sample rates is that the 'requirements' on the anti-aliasing filter relax significantly. If you sample content with a bandwidth of 0-20 kHz with 44 kilosamples/s then you need a filter that can drop from almost no attenutation at 20 kHz to perhaps 60-70 dB attenuation by 22 kHz, which will be a very high order filter. If you sample at 96 kilosamples/s, that filter has to drop the same amount within a much larger span of 20-ish kHz, meaning it is much easier. And that doesn't just improve the roll-off, but because the filter requirements are relaxed it is easier to get a nice flat filter response in the passband.

Udhaya kumar A - 2019-05-21

Dave, you got a new oscilloscope SDS5104X. Can you please do a full review video and if possible compare with keysight and Tektronix.
I had a plan to purchase this earlier because it's a decent spec 1GHz oscilloscope in the market with very lower cost. I don't believe in the marketing videos and I looking for your opinion on this.

iamdarkyoshi - 2019-05-21

Thumbnail has a crude representation of a gentleman's sausage. Brilliant.

Larry Bolan - 2019-05-21

Ah, aliasing. Trap for newbies when it comes to DSPs (which a DSO more or less is a graphical version of).

Rýán Túçk - 2019-05-21

Larry Bolan newbies, yeah I still get my head stuck in a wet paper bag, and I haven’t thought of dick and balls in 39 years.

RedwoodRhiadra - 2019-05-21

The Oscilloscope Interpolation Trap - best Robert Ludlum novel ever.

Jakob Holz - 2019-05-21

Actually fell for that when probing an I2c line.

EEVblog - 2019-05-21

Happens to everyone

Jakob Holz - 2019-05-21

@EEVblog I feel better now ;-)

Bruce Nitroxpro - 2019-05-21

As I used to say to newbies in the field of EE, "Those who know the most math end up as boss."

Boomer U. - 2019-05-22

those that even knew the math existed were half way there, some became the boss.

Boyd Waters - 2019-05-24

The good old days of the Peter Principle.
Has long since been replaced by the Dilbert Principle.
:-)

Julianne Sermon - 2019-05-21

The whole "deep memory" thing seems like a trap for young players... why does it allow you to zoom in beyond what can be reliably rendered from the available data?

KuraIthys - 2019-05-21

I get annoyed by scanners and cameras that do it too.
Especially since they often make a concerted effort to obfuscate what the actual resolution limits of the sensor are. (Especially scanners - my scanner is something like 1200x600 DPI, yet the software just goes up to 3600 dpi and makes absolutely no mention of which, if any of the settings produce an interpolated image.)

Interpolation, especially without explicit warning that it's being done really can be frustrating sometimes...

Denny - 2019-05-21

Yep, fell for that once or twice too, but it´s the way it is, sample memory is either expensive or slow. Going for logic analyzers however does not help when trying to see signal quality. Throwing money at the problem by even higher bandwith scope is not for most hobbyists. The good thing is that MSOs get better and better and you can check signal quality and have data interpretation in one device.

BelkinLogitech123 - 2019-05-21

The interpolation issue has nothing to do with deep memory. Deep memory is amazing and awesome.

Julianne Sermon - 2019-05-21

@BelkinLogitech123 But do you know the answer to my question?

Fried Mule - 2019-05-21

10:00 Genius illustration in upper right corner! Now I think that I really understand what FFT is. Thanks Dave! :-)

Caleb Reister - 2019-05-23

... borrowed directly from Wikipedia: https://en.wikipedia.org/wiki/Fourier_series

Melkior Wiseman - 2019-05-23

Interpolation: A fancy word for "Fill in the gaps."
Extrapolation: A fancy word for "The rest follows the same pattern."

gudenau - 2019-05-21

Technology Connections has a video about this, it's just focused specifically on audio.

AutogolazzoJr - 2019-05-21

I remember that video. Only difference here is that there isn't an upper limit like in human hearing, so aliasing is fair game in digital scopes. Better use peak detect to not worry about aliasing.

William Wallace - 2019-05-21

...I think I may be the only one who assumed dirty joke as a first thought. :\ sigh. This "growing up" thing is a lie. I keep getting older but never grow up.

Andre Gulbis - 2019-05-21

Yep, cock n ballz

KuraIthys - 2019-05-21

No, I think you're not the only one. XD
More like others are too polite to mention it.

I was thinking this was unusually immature of Dave really.
I mean, he's not the most serious person around, but drawing a dick is a particular kind of immature I wasn't expecting. XD

Null Null - 2019-05-21

Naw, you definitely ain't the only one! I'm certain that most people had the same thought at first glance. Indeed, I'm pretty sure Dave had exactly that in mind when making the thumbnail. He mentions that the 10-year-old in him sees it too, and it would've been trivial to make an actual sin x/x curve to put in there. Instead, though, he drew it by hand, inaccurately, in bold, bright red. Silliness like that is part of what makes his videos so great, if ya ask me.

William Wallace - 2019-05-21

To be fair I laughed hard as shit at it and pointed... no one but me is even in the room but I am laughing and pointing anyway. Dick jokes... still amuse decades later...

John Penguin - 2019-05-21

People get really confused about this with digital audio...

It’s a lot of fun!

jtsotherone - 2019-05-21

I think AvE and Dave are slowly converging into one entity, they are sharing the same vocabulary these days. No bad thing!

Drakkar Calethiel - 2019-05-21

jtsotherone That confusor made me laugh!

BlackEpyon - 2019-05-21

Well, I know what he's going to call the next oscilloscope that blows up on him.

victornpb - 2019-05-21

They are slowly developing their own language, in 50years you'll need to learn Aveev to study engineering.

The Antipope - 2019-05-21

Hey, it's fine by me!

David Perkins - 2019-05-23

Great video, Dave!
Even my lowly audio editing program (Cooledit 2000) employs this Sin(x)/x processing.

Michael Rinkle - 2019-05-23

7:29 - It's Retrowave, Dave. B-) Good to know! I have that exact scope, much faster now, just updated to latest firmware.

MrGurkentomate - 2019-05-21

Awesome to see fourier transforms/series in action, basically never heard of them before a course i took last year in university, now I see them everywhere.
If you want to get a deeper introduction into fourier transforms watch 3blue1browns video "But what is the Fourier Transform? A visual introduction"

greenlight04 - 2019-05-21

Basically this is just sampling theorem. Multiplying with delta pulses in the time domain (equals the sampling process) means folding in the frequency domain. If you want the analog signal back you filter in the frequency domain with an ideal rectangel to get only the low frequencies up to the maximum of 200 MHz limited by the bandwidth of the analog frontend (and not the ones that occured as copies of the real signal at higher frequencies due to folding as an effect of sampling in the time domain). This rectangel in the frequency domain corresponds to folding in time domain with sinc aka. Use a sinc-wave for every point in the time domain. If you have too low sampling the frequency copies due to the sampling interfere with the original low signal-frequencies. Trying to filter out the original signal with the ideal frequency rectangle filter aka. Sinc-interpolation in time-domain is not possible anymore and you get nonsense. The time domain sinc is therefore just coming from the ideal rectangle frequency filter. Flies away.

3dlabs99 - 2019-05-21

Would be helpful if the scope showed the sample points when the distance between them goes over a certain threshold. Like with a cross or a circle on top of the interpolated graph.

needforsuv - 2019-05-21

Alternatively, go in as much detail as you need.

If you don't need 5000 'packets' just sample 1 or a few. Or maybe 10

Justin Spencer - 2019-05-22

Always trigger again after zooming in on a signal with the desired t/div.

ChrisGrossmanDOTcom - 2019-05-21

I always maximize the memory and check the sample rate before I zoom in. On my SDS1102X the slowest sweep that will capture at 1 Gs/s is 1ms/div with the full 14M memory depth turned on. It is great for zooming in on the scope, but gives you a vary large file if you want to save the data.

EEVblog - 2019-05-21

Yeah, but you have to know that and do the mental calculation and keep track

ChrisGrossmanDOTcom - 2019-05-21

​@EEVblog You can just watch the sample rate indicator as you adjust the sweep rate. If it drops below 1GS/s your sweep is too long, or you do not have the memory set long enough. You don't need to do it in your head.

Arathok - 2019-05-21

Watching this literally 2 days after checking a signal and taking data from the oscilloscope that "didn't make sense"... I always thought, the oscilloscope is always right! Greatly appreciate this Video!
A must watch for people having to use a oscilloscope in a lab maybe as scientific helper and just started out. I wrote the link down for my fellow students!

EEVblog - 2019-05-22

Everyone gets caught by this eventually!

Flash001USA - 2019-05-21

"It's all smoke and mirrors" That should be on a Tee-Shirt.

BigFoot Too - 2019-05-22

Enough, enough, I'm going back to using my old Tek 475.

Scot Johnson - 2019-05-23

This is probably the most informative video on this subject that's ever been made. Great job and keep up the good work.

Lucien86 - 2019-05-21

What you are seeing is a form of aliasing error, a real curse of all digital sampling... If you don't know to look it catches you out so easily, anything could be hidden between the dots..

AutogolazzoJr - 2019-05-21

In this case, peak detect is your friend. That is, unless your signal has components of higher frequency than the max sampling rate.

Zenodilodon - 2019-05-23

1:30, oh look it's the BROADCOM logo :)

pepe6666 - 2019-12-29

yuck :( i kinda wish that the display just said in red the smoothie line and showed the dots in a different colour. that would be great cos then you can see for yourself the interoperation plus the data points.

ASG_8 - 2019-05-21

You got the persistence in "Infinite" 4:05, there was no bug in 3:45 ...

Boomer U. - 2019-05-22

You are right on the edge of high energy analysis and imaging, just on the other side of "It's Complicated".

Hamilton Mechanical - 2019-05-21

I just bought my first oscilloscope! I'm so excited! I bought an auction lot with 7 oscilloscopes, a couple function generators, and a few digital power supplies. Can't wait to get ahold of them and see how many of them still work!

Manick N - 2019-05-21

Wow I had one of those Tandy calculators in school. A real classic.

wpherigo1 - 2019-05-21

Which is why it’s always a great idea to have 2 ways to measure something, with one of them being analog. You can best understand these issues if you’ve done time with analog scopes before, and understand how digital scopes work.

ZomB1986 - 2019-05-21

There's a speck of dust on my screen. *blows*. d'Oh it's on the scope.

Kiss Analog - 2019-05-21

Great video Dave on a great subject!

TheBypasser - 2019-05-22

Cool, never actually seen it (in fact I use the linear interpolation all the time as it creates those visible slopes that tell you you are undersampling and should recapture).

Rodrigo Andrés Beltrán Politeo - 2019-06-02

AWESOME. Haha its always nice to learn with you.

alphanimal - 2019-05-21

The scope should show the dots on top of the interpolated curve when you zoom in far enough

illchmann - 2019-05-23

noobs trap with digital scopes, thia siglent does it perfect, i like it !

Steve Greenfield - 2019-05-21

There should be no appreciable frequency content by the time you get to 1/2 the sample rate. Rule of thumb: -60dB down by that frequency. Any more causes aliasing.