EEVblog Electronics Community Forum

Electronics => Projects, Designs, and Technical Stuff => Topic started by: ballanux on August 27, 2014, 06:01:34 pm

Title: Advices with DSO input stage design
Post by: ballanux on August 27, 2014, 06:01:34 pm
First of all I must say that I'm doing this as an learning exercise. I want to actually build it, but I know I shouldn't be surprised if it turns out to be totally unusable. I know that if I want a scope I should buy one and it would be better and cheaper than a DIY design :P

As most of you will know Bunnie and Xobs launched a crowdfunding campaign for the open source hardware Novena Laptop. I supported the campaign and bought one :). One of the most interesting features is that the laptop comes with a FPGA. Bunnie has already shown an oscilloscope module for the Novena Laptop (http://www.bunniestudios.com/blog/?p=3957)  but the active probes are designed for very specific measurements.

So, all the digital part of the scope is already designed, but I would like a front end capable of using traditional oscilloscope probes. My goal specifications would be an input stage capable of supporting 350Vrms even with no attenuation on the probe and a bandwidth of about 200MHz.

I must say that although I'm an electronic designer this is outside my experience. I have done quite a bit of research and I have come up with the attached schematic. There is still a lot to be done, but before going on I'm sure you will be able to spot any mistakes that I may have done :) I know there is a lot of people here with experience that will be able to help!

The first part of the schematic is the attenuation, coupling and input buffer. First I tried to design it so it would be possible to have no attenuation at all. But I found out that you can't just do the usual diode voltage clamping with a limiting resistor because the parasitic capacitance of the diodes will act as a low pass filter! (please correct me if I'm wrong). So I put a minimum attenuation of 5:1, that allows the use of smaller diodes and get rid of the series resistor.

(http://i.imgur.com/6LIw0nr.png)

I have never designed a compensated attenuator before and I found out very quickly that it isn't an easy task. I used LTspice to design it mostly by brute force  |O I'm also attaching the simulation result in case that anyone is interested (or can spot a mistake!)

(http://i.imgur.com/3UD3Iv9.png)

The second part of the schematic is the conversion from single ended to differential signal and a PGA with selectable bandwidth and gain. This part is pretty much copy and paste from the design that Bunnie did and the reference design of the LMH6518. Thanks to the selectable bandwidth feature of the PGA I think there is no need for an antialiasing filter but maybe it's still advisable  :-\

(http://i.imgur.com/HGdxnPP.png)

Thanks for any advice you can provide  ^-^

PD: if anyone is interested, I can post links to most of the documents I used to learn about oscilloscope front-ends
Title: Re: Advices with DSO input stage design
Post by: Alex30 on August 28, 2014, 01:00:29 pm
Interesting stuff, hope you get somewhere with it! Unfortunately this is over my head but I am keen on hearing your progress!
Title: Re: Advices with DSO input stage design
Post by: David Hess on August 28, 2014, 10:28:09 pm
Chapter 7 of "The Art and Science of Analog Circuit Design" has a good discussion of relatively modern vertical input signal conditioning:

http://khach2.narod.ru/eBook/Signal_Conditioning_in_Oscilloscopes.pdf (http://khach2.narod.ru/eBook/Signal_Conditioning_in_Oscilloscopes.pdf)

You might want to take a look at the input designs for the later analog oscilloscopes like the Tektronix 2235, 465, and 475.  The designs for the vertical input amplifiers in the 7000 series are also enlightening with the 7A13 being especially so.

The design of the Tektronix 2225 (60 MHz) is probably more representative of what can be accomplished easily as it uses no custom ICs relying instead on general purpose transistor arrays.  This is less of a problem now because of the availability of high frequency integrated amplifiers.

Quote
So, all the digital part of the scope is already designed, but I would like a front end capable of using traditional oscilloscope probes. My goal specifications would be an input stage capable of supporting 350Vrms even with no attenuation on the probe and a bandwidth of about 200MHz.

Do you mean 350 Vrms of overload resistance?  Most oscilloscope front ends only have enough attenuation to operate linearly up to about 50 volts (5 volts per division).

If you are talking about overload resistance before damage, keep in mind that this specification is derated at higher frequencies.  A Tektronix 2235 for instance is specified to withstand 400 volts peak at 10 kHz and below but only good to 12.5 volts at 500 kHz and higher.

Quote
The first part of the schematic is the attenuation, coupling and input buffer. First I tried to design it so it would be possible to have no attenuation at all. But I found out that you can't just do the usual diode voltage clamping with a limiting resistor because the parasitic capacitance of the diodes will act as a low pass filter! (please correct me if I'm wrong). So I put a minimum attenuation of 5:1, that allows the use of smaller diodes and get rid of the series resistor.

It helps to use the right kind of diodes and topology.  If the input may be configured with no attenuation at all which is typical to get 2 to 10 millivolts per division level of sensitivity, protection cannot rely on attenuator impedance.  Usually there is a relatively high value capacitively bypassed resistor in series with the input to the buffer with protection diodes after it.  If a JFET is used, its junction may serve as one of the protection diodes.

Suitable protection diodes are both low leakage and low capacitance and not necessarily fast recovery.  A JFET with drain and source tied together may be used as a diode for this function.  Bipolar transistor base-emitter junctions are also suitable if their low breakdown voltage is acceptable.  I find that suitable dedicated low leakage diodes are both expensive and have poor availability.

Oscilloscope bandwidth with a high impedance vertical input is specified assuming a 25 ohm source which originates from a 50 ohm terminated transmission line.  Oscilloscope probes are specified the same way.  That may partially explain your poor simulation results when the capacitance of the protection diodes is included.
Title: Re: Advices with DSO input stage design
Post by: T3sl4co1l on August 28, 2014, 11:57:18 pm
I was all getting excited to write another monster post, but I guess I'll just have to say,  this ^^^ :P

As noted, attenuators aren't easy.  Rather than a huge tower, you're better off making discrete attenuator stages, and matching them by Rin-Rout and Cin-Cout.  And then when you want 10x vs. 1x attenuation, you use a DPDT switch to connect the input and output to that attenuator stage, or bypass around it -- ensuring that the bypass node has the same equivalent loading capacitance as well, or alternately, that the trace length / area is reasonably equal.  (Which is yet another thing to consider: length tuning!)

One thing I will note that may not've been mentioned, or been obvious: connecting resistors in series, or using physically large resistors, is tricky.  The capacitance on the inbetween node, or the distributed capacitance to the surroundings, needs to be accommodated somehow.  If you forget this, then you'll get the right gain at DC (it's set by the resistors), and at HF (set by the capacitors), but at some intermediate frequency, you'll get a dip (because of the unforeseen capacitance between resistors and ground).  Which means your square wave response will be very slightly sloppy, something you can't adjust with the probe compensation.

Small resistors help with this, obviously, but mind that chip resistors usually top out at 75V or 100V.

Tim
Title: Re: Advices with DSO input stage design
Post by: David Hess on August 29, 2014, 03:34:31 am
As noted, attenuators aren't easy.  Rather than a huge tower, you're better off making discrete attenuator stages, and matching them by Rin-Rout and Cin-Cout.  And then when you want 10x vs. 1x attenuation, you use a DPDT switch to connect the input and output to that attenuator stage, or bypass around it -- ensuring that the bypass node has the same equivalent loading capacitance as well, or alternately, that the trace length / area is reasonably equal.  (Which is yet another thing to consider: length tuning!)

For a long time at 200 MHz and below Tektronix used modular high impedance attenuators built as thick film hybrids.  Each had 2 adjustments to trim input capacitance and compensation.

One thing to watch out for in high impedance attenuators is hook.  Tektronix published an article called "Getting Rid of Hook - The Hidden PC-Board Capacitance" and Analog Devices mentions it in some of their application notes.  I could not find any links to the Tektronix article online so here is a magnet bittorrent link to it:

magnet:?xt=urn:btih:B2C4280F729C9EF0EB1DBDE8161A64DDEE47795E

Another trick you can use is that those relatively inexpensive subminiature DPDT relays which have the rotating armature and the contacts at the bottom are good to 100s of MHz (Some are rated to 1 GHz+ but I think that is optimistic where transient response matters.) in high or low impedance attenuators.  Tektronix made their own for years and started using them in 1969 if not earlier.
Title: Re: Advices with DSO input stage design
Post by: Smokey on August 29, 2014, 05:17:42 am
Chapter 7 of "The Art and Science of Analog Circuit Design" has a good discussion of relatively modern vertical input signal conditioning:

http://khach2.narod.ru/eBook/Signal_Conditioning_in_Oscilloscopes.pdf (http://khach2.narod.ru/eBook/Signal_Conditioning_in_Oscilloscopes.pdf)
....

That's a great read!
Title: Re: Advices with DSO input stage design
Post by: David Hess on August 29, 2014, 02:06:07 pm
ballanux, I could not see your schematics earlier (imgur having problems?) so I have some direct comments now:

1. I doubt that high impedance attenuator string will work if only because the input capacitance will change with attenuation and adjustment is going to be difficult.  I would use a two stages of Pi attenuators with the DPDT relays I mentioned.  Each stage has two trimmer capacitors.

2. Another trimmer is needed where C217 is to set the input capacitance with no attenuation.  In old oscilloscopes this is called normalizing and it allows attenuating probes to be switched between channels and instruments without adjusting compensation.

3. Being able to ground the input is a good idea but it should be done before the attenuator so the offset do to bias current can be measured; the bias current causes an offset through the input protection resistance and attenuator resistance.  The input should also be disconnected when this occurs.  Designs that include a switchable 50 ohm termination use that to ground the input to the attenuator while disconnected the input where the AC/DC coupling circuits are.  They also include a finite disconnect resistance so grounding the input may be used to precharge the AC coupling capacitor which needs to be moved to the input for this to work.  This also means that the AC coupling capacitor needs to be moved to the input instead of after the high impedance attenuator.

4. The BAV199 diodes look great.  I am going to have to remember that part.  You could use two diodes in series on each side to halve the capacitance.  Keep in mind that the diodes are slow so overload will cause a long recovery time; this means that the diodes cannot be relied on to clamp the input with a goal of fast recovery.  Transistor base-emitter junctions would be much faster.

5. The RC network for protecting the amplifier and limiting current into the protection diodes would go where C219 is.

6. A low impedance switched attenuator could be added to the output of U201 and it could look like your existing attenuator design but without the capacitors.  Tektronix usually included at least x2.5 and x5 stages here.

7. I think either operational amplifier will work but they are specified assuming a load resistance of 100 ohms from a doubled terminated 50 ohm transmission line.  I might take advantage of that by assuming a gain of 1/2 in that stage.  I wonder what kind of recovery time those operational amplifiers have.

8. A variable input offset could be added at the inverting inputs of the ADA4938 amplifiers using a simple DAC.  This is a pretty useful function in some applications.  Some DSOs use the offset added at this point for trace positioning and others have separate trace position and offset controls.
Title: Re: Advices with DSO input stage design
Post by: ballanux on August 29, 2014, 11:21:24 pm
Wow, thank you all so much for your comments, I know that analyzing this kind of schematics takes some time even if you have experience in the matter. It will take me a while to process all the information that you have given, but I will try to implement all the advices.

I have looked at the Tektronix 454 schematics and I saw that it had two 10:1 attenuators in series, but it didn't show the internals of the attenuators. I will search for some other models. I did my attenuator based on
this design of the book "Electronic Instrumentation" (http://books.google.es/books?id=ECbjfoJQ6MoC&pg=PA209&lpg=PA209&dq=compensated+switchable+attenuator&source=bl&ots=LuFRucEQF-&sig=04agda47i8OZk879as1h12LTgjQ&hl=es&sa=X&ei=79vzU6iPEInnygOYwYLgDQ&ved=0CGoQ6AEwCA#v=twopage&q&f=false), but I will do some more research and try to design a two stage attenuator.

For the input protection I was aiming to be able to sustain direct contact with mains power (230V 50Hz here), just in case, but I wasn't hoping for more. I have worked in some power factor correction designs which involves high frequencies, but for that I always use HV differential probes :)

The BAV199 diodes are used in Rigol scopes, I saw them thanks to Dave's teardown photos and some schematics there are in this forum

I will study all of T3sl4co1l and David advices, make the changes and I will post the modifications.

Oh! and if anyone wants to know more in this matter, here are some interesting resources I have used (I'm also adding the chapter David suggested):

Novena Scope Schematics:
http://www.bunniestudios.com/blog/?p=3957 (http://www.bunniestudios.com/blog/?p=3957)

Rigol DS1052 schematics:
https://www.eevblog.com/forum/blog/rigol-ds1052e-nasty-surprise (https://www.eevblog.com/forum/blog/rigol-ds1052e-nasty-surprise)!/msg55197/#msg55197

Bitscope schematics:
http://www.bitscope.com/design/hardware/ (http://www.bitscope.com/design/hardware/)

LMH6518 datasheet:
http://www.ti.com/lit/ds/symlink/lmh6518.pdf (http://www.ti.com/lit/ds/symlink/lmh6518.pdf)

Appnote TI "High-Performance Analog Front Ends":
http://www.ti.com/lit/wp/snoa828/snoa828.pdf (http://www.ti.com/lit/wp/snoa828/snoa828.pdf)

Appnote TI Active low pass filter design SLOA049B:
http://www.ti.com/lit/an/sloa049b/sloa049b.pdf (http://www.ti.com/lit/an/sloa049b/sloa049b.pdf)

DSP guide. Chapter 3 (filters):
http://dspguide.com/ (http://dspguide.com/)

Practical Antialiasing filters:
http://www.cpdee.ufmg.br/~fvasc/Disciplinas/Sismed/Textos/Practical%20Antialiasing%20Filters.pdf (http://www.cpdee.ufmg.br/~fvasc/Disciplinas/Sismed/Textos/Practical%20Antialiasing%20Filters.pdf)

Student DSO proyect:
http://web.mit.edu/6.111/www/f2013/projects/kramnik_Project_Final_Report.pdf (http://web.mit.edu/6.111/www/f2013/projects/kramnik_Project_Final_Report.pdf)

Oscilloscope compensated attenuator:
http://books.google.es/books?id=ECbjfoJQ6MoC&lpg=PR1&hl=es&pg=PA209#v=twopage&q&f=false (http://books.google.es/books?id=ECbjfoJQ6MoC&lpg=PR1&hl=es&pg=PA209#v=twopage&q&f=false)

Oscilloscope probes:
http://dfad.com.au/links/THE%20SECRET%20WORLD%20OF%20PROBES%20OCt09.pdf (http://dfad.com.au/links/THE%20SECRET%20WORLD%20OF%20PROBES%20OCt09.pdf)
http://www.ece.vt.edu/cel/docs/TekProbeCircuits.pdf (http://www.ece.vt.edu/cel/docs/TekProbeCircuits.pdf)

High speed differential ADC driver design:
http://www.analog.com/static/imported-files/application_notes/AN-1026.pdf (http://www.analog.com/static/imported-files/application_notes/AN-1026.pdf)

Signal Conditioning in Oscilloscopes:
http://khach2.narod.ru/eBook/Signal_Conditioning_in_Oscilloscopes.pdf (http://khach2.narod.ru/eBook/Signal_Conditioning_in_Oscilloscopes.pdf)

Title: Re: Advices with DSO input stage design
Post by: T3sl4co1l on August 30, 2014, 12:13:07 am
Practical Antialiasing filters:
http://www.cpdee.ufmg.br/~fvasc/Disciplinas/Sismed/Textos/Practical%20Antialiasing%20Filters.pdf (http://www.cpdee.ufmg.br/~fvasc/Disciplinas/Sismed/Textos/Practical%20Antialiasing%20Filters.pdf)

BTW...

Don't do that ^^^.  Can you tell why? ;)

Tim
Title: Re: Advices with DSO input stage design
Post by: David Hess on August 30, 2014, 02:24:04 am
I have looked at the Tektronix 454 schematics and I saw that it had two 10:1 attenuators in series, but it didn't show the internals of the attenuators. I will search for some other models.

I think I have seen the attenuator module details somewhere but I did a quick search and did not find them.

The 7A12, 7A13, 7A15 (not the 7A15A), and 7A16 (not the 7A16A) schematics show how the discrete implementations worked before the hybrid modules were introduced.

The 7A11 shows how *not* to do it.  It uses SPDT switches but each attenuator section can only adjust compensation and not input capacitance which is not what you want for a vertical input that uses interchangeable probes.

If you buffer stage has enough dynamic range, then you only need maybe two high impedance attenuators and the rest can be low impedance attenuators after the input buffer like with the 22xx series oscilloscopes.

Quote
For the input protection I was aiming to be able to sustain direct contact with mains power (230V 50Hz here), just in case, but I wasn't hoping for more. I have worked in some power factor correction designs which involves high frequencies, but for that I always use HV differential probes :)

This is very doable but keep in mind that the resistors and capacitors before the protection diodes need to be able to sustain the high voltage without breakdown.  That will exclude some of the smaller surface mount parts.
Title: Re: Advices with DSO input stage design
Post by: ballanux on August 30, 2014, 09:36:40 am
Practical Antialiasing filters:
http://www.cpdee.ufmg.br/~fvasc/Disciplinas/Sismed/Textos/Practical%20Antialiasing%20Filters.pdf (http://www.cpdee.ufmg.br/~fvasc/Disciplinas/Sismed/Textos/Practical%20Antialiasing%20Filters.pdf)

BTW...

Don't do that ^^^.  Can you tell why? ;)

Tim

Ok, trying not to make a fool of myself I have searched a bit more on the matter and I think that I would lose the ability to do equivalent-time sampling to capture higher frequency repetitive waveforms like explained here:

http://www.bitscope.com/design/hardware/convertor/?p=bandwidth (http://www.bitscope.com/design/hardware/convertor/?p=bandwidth)

and discussed here (by yourself!)

www.eevblog.com/forum/projects/what-type-of-antialiasing-filter-is-used-in-a-digital-scope/ (https://www.eevblog.com/forum/projects/what-type-of-antialiasing-filter-is-used-in-a-digital-scope/)

Title: Re: Advices with DSO input stage design
Post by: ballanux on August 30, 2014, 09:53:08 am

The 7A12, 7A13, 7A15 (not the 7A15A), and 7A16 (not the 7A16A) schematics show how the discrete implementations worked before the hybrid modules were introduced.


Thank you for that references! I have found the TekWiki (http://w140.com/tekwiki/wiki/Main_Page) page and wow, that site is great! This will be very usefull! (http://w140.com/tekwiki/images/6/6c/Tek_7a12_attenuators.png)

About the voltage across the resistors, I will use multiple 0805 or 1206 resistors in series so they won't exceed 100V, the 1206 ones can work up to 200V, but its better to be safe :)

Edit: I also found a patent from tektronix which shows the internal schematic of their hybrid attenuator:
https://www.google.com/patents/US4181903 (https://www.google.com/patents/US4181903)
Title: Re: Advices with DSO input stage design
Post by: T3sl4co1l on August 30, 2014, 01:18:01 pm
Practical Antialiasing filters:
http://www.cpdee.ufmg.br/~fvasc/Disciplinas/Sismed/Textos/Practical%20Antialiasing%20Filters.pdf (http://www.cpdee.ufmg.br/~fvasc/Disciplinas/Sismed/Textos/Practical%20Antialiasing%20Filters.pdf)

BTW...

Don't do that ^^^.  Can you tell why? ;)

Tim

Ok, trying not to make a fool of myself I have searched a bit more on the matter and I think that I would lose the ability to do equivalent-time sampling to capture higher frequency repetitive waveforms like explained here:

http://www.bitscope.com/design/hardware/convertor/?p=bandwidth (http://www.bitscope.com/design/hardware/convertor/?p=bandwidth)

and discussed here (by yourself!)

www.eevblog.com/forum/projects/what-type-of-antialiasing-filter-is-used-in-a-digital-scope/ (https://www.eevblog.com/forum/projects/what-type-of-antialiasing-filter-is-used-in-a-digital-scope/)

Yup -- why waste bandwidth when you can see the signal as it is?

I suppose there are two camps of sampling design: either sample it exactly as it looks (given the bandwidth of the front end and the ADC's internal S&H), understanding that, if there is high frequency content, you're not going to get the best view of it (say if it's incoherent with the main trigger signal), and that at high sample rates, you're viewing the reconstructed, repetitive signal only; or, filter it the heck down, so you can full speed sample all the time (triggered or otherwise), at the expense of needing a ridiculous amount of sampling power (gigasamples for a mere 200MHz), but you know you aren't missing anything within the bandwidth.

One funny thing about continuous (band limited) sampling is, you can do the trigger in software -- that is, while having the confidence that you aren't missing edges over the bandwidth.  Suppose sample N is above the threshold, and N+1 is below: the falling edge trigger point is roughly apparent, but to get 'subpixel' accuracy, you'd want to interpolate (using a function representative of the analog step response -- sinc(x) isn't generally appropriate, despite its popularity) to find the apparent crossing point, then time-shift all subsequent ("triggered") samples by that amount.  Which requires having a fractional-sample time-shift interpolation function, which is an interesting thought.  I suppose one could take an FIR filter and tweak the coefficient weights left or right by small increments to make it slightly 'pear shaped' one way or the other, to get a reasonable approximation of this.

Tim
Title: Re: Advices with DSO input stage design
Post by: David Hess on August 30, 2014, 03:04:42 pm
Thank you for that references! I have found the TekWiki (http://w140.com/tekwiki/wiki/Main_Page) page and wow, that site is great! This will be very usefull! (http://w140.com/tekwiki/images/6/6c/Tek_7a12_attenuators.png)

TekWiki is pretty neat.  I have a few documents hosted their myself.  Kurt is a great guy.

The 7A16 service manual shows attenuator sections of x1, x2.5, x5, x10, x25, x50, x100, and x250.  The 7A15 service manual shows attenuator sections of x1, x2, x4, x10, x100, and x1000.  I would compare the similarities and differences between all of them to get a better idea of what is required.

Quote
About the voltage across the resistors, I will use multiple 0805 or 1206 resistors in series so they won't exceed 100V, the 1206 ones can work up to 200V, but its better to be safe :)

Tektronix used a thick film process for their attenuator hybrids.  One reason for this was to control the voltage coefficient of resistance which would otherwise cause significant errors.  My understanding is that thin film processes have problems with this making them unsuitable if both high voltage and high accuracy are desired.  Early on it was a custom process because nobody made high voltage resistors which were good enough.

From the looks of it, thick film resistors are the way to go because you can get a 500 volt rating in a 1206 package and a 400 volt rating in an 0805 package.  Finding the right values are going to be a problem but there are two things you can do about it:

1. High value shunt resistances can be used to trim impedance without changing attenuation factors.

2. Calibration can be done on the digital side.  It is not important that the attenuators have exact values so much as that they have constant and known values.  The later analog (!) and digital oscilloscopes calibrated out attenuator errors.  Take a look at the vertical calibration procedure in the 2465 series service manual to get an idea for how this works.

I see some 500 volt resistors in 0603 and 0402 packages but selection is limited.

Quote
Edit: I also found a patent from tektronix which shows the internal schematic of their hybrid attenuator:
https://www.google.com/patents/US4181903 (https://www.google.com/patents/US4181903)

I think I have seen that assembly before but not in a Tektronix instrument which was an oscilloscope.
Title: Re: Advices with DSO input stage design
Post by: David Hess on August 30, 2014, 03:32:36 pm
Yup -- why waste bandwidth when you can see the signal as it is?

I suppose there are two camps of sampling design: either sample it exactly as it looks (given the bandwidth of the front end and the ADC's internal S&H), understanding that, if there is high frequency content, you're not going to get the best view of it (say if it's incoherent with the main trigger signal), and that at high sample rates, you're viewing the reconstructed, repetitive signal only; or, filter it the heck down, so you can full speed sample all the time (triggered or otherwise), at the expense of needing a ridiculous amount of sampling power (gigasamples for a mere 200MHz), but you know you aren't missing anything within the bandwidth.

I am completely in the "anti-aliasing filters have no place in time domain instruments" camp:

1. If the anti-aliasing filter is going to track the sample rate or decimated sample rate, then the frequency and phase response of the oscilloscope is changing as the sample rate changes and that can happen with different record lengths.  That will make for a wonderful tail about how the DSO lied to me.

2. If anti-aliasing occurs as part of decimation, then the Gibbs phenomenon is going to screw up the time domain response anyway.  If the Gibbs phenomenon does not appear, then anti-aliasing was not needed.  I have seen this first hand on some very expensive high end oscilloscopes when they used DSP filtering in place of analog bandwidth limiting.  Oddly enough some fast vertical signal chains in analog and digital storage oscilloscopes suffer from a very similar problem that has nothing to do with digital filtering.

Quote
One funny thing about continuous (band limited) sampling is, you can do the trigger in software -- that is, while having the confidence that you aren't missing edges over the bandwidth.  Suppose sample N is above the threshold, and N+1 is below: the falling edge trigger point is roughly apparent, but to get 'subpixel' accuracy, you'd want to interpolate (using a function representative of the analog step response -- sinc(x) isn't generally appropriate, despite its popularity) to find the apparent crossing point, then time-shift all subsequent ("triggered") samples by that amount.  Which requires having a fractional-sample time-shift interpolation function, which is an interesting thought.  I suppose one could take an FIR filter and tweak the coefficient weights left or right by small increments to make it slightly 'pear shaped' one way or the other, to get a reasonable approximation of this.

Next time I get my hands on a DSO with digital triggering, I want to test this with a fast edge or high frequency sine wave.

I suspect mixing between the signal and sampling frequency do to non-linearity and sampling error in the digitizer will produce sidebands which alias thereby affecting the digital trigger among other things and anti-aliasing will not fix this.  On a practical level, this should result in fast edges looking significantly noisier in time and amplitude than they really are.

The problem here as I see it with digital triggering is that the aliasing screws that up also so equivalent time sampling cannot fix it like it can on a DSO using analog triggering.
Title: Re: Advices with DSO input stage design
Post by: David Hess on August 30, 2014, 03:49:34 pm
www.eevblog.com/forum/projects/what-type-of-antialiasing-filter-is-used-in-a-digital-scope/ (https://www.eevblog.com/forum/projects/what-type-of-antialiasing-filter-is-used-in-a-digital-scope/)

I am sorry that I missed that discussion.  I would have enjoyed giving them a piece of my mind.

The summary of my position is that filtering to prevent aliasing (as opposed to filtering to limit noise which is different) in a time domain instrument lowers usable performance for no gain and trades one set of lies for another set of lies and a false sense of security.

My old real-time, non-real time, and marginally real-time DSOs get along fine without anti-aliasing although they all support peak detection during decimation or sampling which is a must have feature in my opinion.

This brings up a different issue with your DSO input stage project.  A switchable bandwidth limit of somewhere between 5 and 20 MHz for reducing noise is very convenient in a DSO.  It is also fairly easy to implement *without* relays in the low impedance signal chain.
Title: Re: Advices with DSO input stage design
Post by: T3sl4co1l on August 30, 2014, 05:21:09 pm
I am completely in the "anti-aliasing filters have no place in time domain instruments" camp:

1. If the anti-aliasing filter is going to track the sample rate or decimated sample rate, then the frequency and phase response of the oscilloscope is changing as the sample rate changes and that can happen with different record lengths.  That will make for a wonderful tail about how the DSO lied to me.

The digitally-implemented version being "hi res" mode (as Tek and others used), or selectable (on screen / digital) bandwidth (mostly available on newer models?).

It's handy, but also hides things.  If you want to see noise, even if it's aliased, you want "sample" mode (peaks will pop in and out as the signal and trigger jitter around), or "peak" mode if you have the excess sample rate.

Probably, the popularity of excess sample rate stems from the consistency of being able to say, yep, here's the bandwidth, here's the signal, you can see full sample rate in a single shot trigger, and you can do much more, digitally, without having to worry about incoherent signals or transients maybe being there or not.

Downside being, oh look it's a 1GS scope that doesn't even do as much bandwidth as my 100MS scope, what a waste.

Quote
2. If anti-aliasing occurs as part of decimation, then the Gibbs phenomenon is going to screw up the time domain response anyway.  If the Gibbs phenomenon does not appear, then anti-aliasing was not needed.  I have seen this first hand on some very expensive high end oscilloscopes when they used DSP filtering in place of analog bandwidth limiting.  Oddly enough some fast vertical signal chains in analog and digital storage oscilloscopes suffer from a very similar problem that has nothing to do with digital filtering.

I'm not sure you have that quite in order, there...

- Antialiasing is the process of removing high frequency components (so the signal satisfies the Nyquist theorem), and of smoothing or interpolating between nearby samples to minimize frequency content near Fs/2.  (The latter is easily seen from using an FIR filter to smooth digital samples, or for a graphical example, blurring a line slightly so it doesn't look all jagged and pixelated when drawn on a grid.)

- Decimation is the process of reducing the sample rate, so frequencies that are already present in the primary (already discrete-time) source have the potential to produce lower frequency aliases in the result.  If these are filtered beforehand, the result will be representative, in as much as, the frequencies which that low sample rate can support will be present, and nothing added.

- Gibbs phenomenon is, at its root, a manifestation of marginal convergence resulting from discontinuous boundary conditions.  The Fourier transform of an ideal step is an infinite series of sine waves, amplitude going as 1/N.  The truncated series, however, is not a step, but approximates it, with ringing around the edge.  This is, by definition, the step response of a brick wall filter.

So... if antialiasing occurs, it's because it's implemented; otherwise, aliasing may occur (that was probably just a typo).  Gibbs phenomenon does not occur in any digital sampling process.  It can be approximated, intentionally, when it is desirable to do so, i.e., when a sharp frequency response is desired.  But it's up to the designer to specify and implement that filter, if he chooses to perform a filtering operation, in decimation or other cases.

As for analog or digital: both suffer from bandwidth, peaking and rise time versus flatness compromises, some worse than others.  A good old Tek 475 is tuned for a linear-phase type characteristic -- which means its vertical signal chain must have bandwidth several octaves beyond the nominal 200MHz, no small feat.  I haven't tested myself, but I understand a number of newer (TDS2k series??) scopes have been tuned for rise time instead, resulting in nasty step responses.

The filter characteristic is a design issue exclusively, it can be implemented in either domain.

Quote
Next time I get my hands on a DSO with digital triggering, I want to test this with a fast edge or high frequency sine wave.

I suspect mixing between the signal and sampling frequency do to non-linearity and sampling error in the digitizer will produce sidebands which alias thereby affecting the digital trigger among other things and anti-aliasing will not fix this.  On a practical level, this should result in fast edges looking significantly noisier in time and amplitude than they really are.

The problem here as I see it with digital triggering is that the aliasing screws that up also so equivalent time sampling cannot fix it like it can on a DSO using analog triggering.

Hmm, interesting.  If they've done their homework and made the analog filter cutoff sharp enough before Fs/2, it should be a null result, as one would hope.

If not, there's still digital filtering, but this can only remove already-aliased components, so they would hopefully try to keep that to a minimum so as to not kill the BW/Fs ratio even more.  Which means relatively small (few tap) filters, and poor cutoff (< 40dB attenuation?) for frequencies near, say, Fs/4 to Fs/2.

So, if they were overly lazy about the analog bandwidth, they may've tried their best to patch over it digitally, but won't be able to do nearly as good a job as doing it analog.

Tim
Title: Re: Advices with DSO input stage design
Post by: David Hess on August 30, 2014, 08:52:48 pm
I am completely in the "anti-aliasing filters have no place in time domain instruments" camp:

1. If the anti-aliasing filter is going to track the sample rate or decimated sample rate, then the frequency and phase response of the oscilloscope is changing as the sample rate changes and that can happen with different record lengths.  That will make for a wonderful tail about how the DSO lied to me.

The digitally-implemented version being "hi res" mode (as Tek and others used), or selectable (on screen / digital) bandwidth (mostly available on newer models?).

High resolution mode was available pretty early on even in low end DSOs but back then the low end was still pretty expensive.  The exceptions were those that used alternative sampling schemes and those which lacked the ability to do more than simple decimation in real time.

Quote
It's handy, but also hides things.  If you want to see noise, even if it's aliased, you want "sample" mode (peaks will pop in and out as the signal and trigger jitter around), or "peak" mode if you have the excess sample rate.

I agree that it is handy although I get along without it.  All of my DSOs are old enough to drink.

High resolution mode is not a panacea for aliasing though and possibly even worse, the sinc type response it creates is non-linear if it is done naively.  Sampling oscilloscopes have the same issue.  In both cases, the Tr=0.35/BW approximation for a Gaussian response fails but I have yet to see this cause a problem in real life.

One of the very early Tektronix DSOs, the 7D20, has a cosine instead of sinc response in some acquisition modes with a 3dB bandwidth of 1/2 the Nyquist frequency and a null at the Nyquist frequency which caused confusion.  They had to explain it in both the operation manual and the service manual and probably in some other places that I missed.

Quote
Probably, the popularity of excess sample rate stems from the consistency of being able to say, yep, here's the bandwidth, here's the signal, you can see full sample rate in a single shot trigger, and you can do much more, digitally, without having to worry about incoherent signals or transients maybe being there or not.

I like high real time samples rate as much as anybody but like long record lengths, I find that a minority of applications require it.

Quote
Downside being, oh look it's a 1GS scope that doesn't even do as much bandwidth as my 100MS scope, what a waste.

Two things I have noticed is that a majority of applications work fine with short record lengths and equivalent time sampling and the ones that require long record lengths usually do not need the fastest real time sampling rates anyway.  Given this, I would much rather have high bandwidth and equivalent time sampling support than high real time sampling rate alone.

Quote
Quote
2. If anti-aliasing occurs as part of decimation, then the Gibbs phenomenon is going to screw up the time domain response anyway.  If the Gibbs phenomenon does not appear, then anti-aliasing was not needed.  I have seen this first hand on some very expensive high end oscilloscopes when they used DSP filtering in place of analog bandwidth limiting.  Oddly enough some fast vertical signal chains in analog and digital storage oscilloscopes suffer from a very similar problem that has nothing to do with digital filtering.

...

- Gibbs phenomenon is, at its root, a manifestation of marginal convergence resulting from discontinuous boundary conditions.  The Fourier transform of an ideal step is an infinite series of sine waves, amplitude going as 1/N.  The truncated series, however, is not a step, but approximates it, with ringing around the edge.  This is, by definition, the step response of a brick wall filter.

So... if antialiasing occurs, it's because it's implemented; otherwise, aliasing may occur (that was probably just a typo).  Gibbs phenomenon does not occur in any digital sampling process.  It can be approximated, intentionally, when it is desirable to do so, i.e., when a sharp frequency response is desired.  But it's up to the designer to specify and implement that filter, if he chooses to perform a filtering operation, in decimation or other cases.

This is where it gets tricky for me and I am probably not explaining it very well.

I agree that series truncation during DSP filtering creates the Gibbs phenomenon however lets say for the sake of argument that no DSP filtering occurs, the digitizer is real with non-linearity in the amplitude domain and sampling jitter in the time domain, and the digitized signal is either a clean sine wave or a bandwidth limited edge.  Both display the problem as I found out but the edge will produce a more recognizable result.  The results of mixing the sampling frequency with the original signal produces sidebands some of which are above the Nyquist frequency producing aliasing even though the input signal by itself has no frequency components above the Nyquist frequency.  The resulting digitized signal when reconstructed (the original sample points are retained) displays the same characteristics as Gibbs phenomenon!  It has pre-shoot, overshoot, amplitude, and phase variations.

To me that means that the digital triggering is going to alias as well unless the non-linearity and sampling error in the digitizer is corrected somehow.

I will admit that for most applications this imperfection is irrelevant and will not be noticed however most of my experience is with oscilloscopes which support equivalent time sampling and have analog triggering which largely ameliorates it.  That is why now that I am aware of it, I am looking forward to evaluating how a modern DSO behaves under these circumstances.

Quote
As for analog or digital: both suffer from bandwidth, peaking and rise time versus flatness compromises, some worse than others.  A good old Tek 475 is tuned for a linear-phase type characteristic -- which means its vertical signal chain must have bandwidth several octaves beyond the nominal 200MHz, no small feat.  I haven't tested myself, but I understand a number of newer (TDS2k series??) scopes have been tuned for rise time instead, resulting in nasty step responses.

The filter characteristic is a design issue exclusively, it can be implemented in either domain.

Modern DSOs, or at least the higher bandwidth ones, tend to be tuned for transition time instead of linear phase response.  I have seen arguments on both sides about which is better and suspect it ultimate depends on the application and the user's expectations and understanding.

Tektronix had at least one analog oscilloscope which could be optionally tuned for higher bandwidth and faster transition times at the expense of linear phase response.  The 7704A was available with option 09 which increased the bandwidth from 200 MHz to 250 MHz but sacrificed optimum pulse response.  I have often though that the 200 MHz 475 and 250 MHz 475A shared a similar relationship with the 475A sacrificing pulse response for higher bandwidth but the marketing, specifications, and calibration instructions rule that out.  Their service manuals sometimes give calibration instructions to adjust for specific levels of overshoot but this may be because of the difference between a 25 ohm calibration source and the passive probes that were designed for the instrument.

I think the most interesting example of this behavior is with the Tektronix 2465 (analog) series and 2440 (DSO) series which both usually display overshoot *and* preshoot in the analog domain.  The preshoot is understandable in the 2465 because of its high performance analog delay line but how does that explain the 2440 which lacks a delay line?  I suspect both require compensation to correct for this that was included in their high frequency passive probes.

Quote
Quote
Next time I get my hands on a DSO with digital triggering, I want to test this with a fast edge or high frequency sine wave.

I suspect mixing between the signal and sampling frequency do to non-linearity and sampling error in the digitizer will produce sidebands which alias thereby affecting the digital trigger among other things and anti-aliasing will not fix this.  On a practical level, this should result in fast edges looking significantly noisier in time and amplitude than they really are.

The problem here as I see it with digital triggering is that the aliasing screws that up also so equivalent time sampling cannot fix it like it can on a DSO using analog triggering.

Hmm, interesting.  If they've done their homework and made the analog filter cutoff sharp enough before Fs/2, it should be a null result, as one would hope.

As I mentioned above, the analog filtering irrelevant because the aliasing is produced in the digitizer itself.  I have personally observed this effect in old and new DSOs but I was not aware of the cause until recently and have not had a chance to go back and investigate how it might affect digital triggering.  In single shot mode, it looks identical to Gibbs phenomenon which initially was very confusing.  With multiple acquisitions, it produces what I like to call "wobbulation".

Quote
If not, there's still digital filtering, but this can only remove already-aliased components, so they would hopefully try to keep that to a minimum so as to not kill the BW/Fs ratio even more.  Which means relatively small (few tap) filters, and poor cutoff (< 40dB attenuation?) for frequencies near, say, Fs/4 to Fs/2.

So, if they were overly lazy about the analog bandwidth, they may've tried their best to patch over it digitally, but won't be able to do nearly as good a job as doing it analog.

I believe the coherent errors can be digitally corrected with a non-linear filter in the same way that predistortion works with an RF amplifier but I am not aware of any manufacturer admitting to doing this.  At the low end within the bandwidth of high impedance passive probes, I suspect it is more cost effective to just avoid the aliasing in the first place.