Smoothing waveform data captured by a DSO? - diyAudio
Go Back   Home > Forums > Design & Build > Equipment & Tools

Equipment & Tools From test equipment to hand tools

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 29th August 2013, 07:11 PM   #1
diyAudio Member
 
Join Date: May 2011
Location: Silicon Valley
Default Smoothing waveform data captured by a DSO?

I told my low-end Rigol digital oscilloscope to dump a waveform into a .CSV file on my thumb drive. When I plotted that data, it had ugly LSB noise and quantisation jaggy lines. Yuck.

I wonder if anyone else has seen this problem and cooked up a solution ,or a workaround, or a sleazy kludge? What do you do and how well does it work?

I'm considering using Savitzky-Golay smoothing (Wikipedia link) to sand off the roughness: example picture attached. Any advice on this?
Attached Images
File Type: png smoothed_DSO_data.png (30.5 KB, 99 views)
  Reply With Quote
Old 29th August 2013, 07:35 PM   #2
jcx is online now jcx  United States
diyAudio Member
 
Join Date: Feb 2003
Location: ..
dither and average on the aquisition side, filter before the 'scope probe if aliasing is a potential

you should ask the purpose of the graphic, dtermine what information it should convey
  Reply With Quote
Old 8th September 2013, 08:39 AM   #3
alayn91 is offline alayn91  France
diyAudio Member
 
alayn91's Avatar
 
Join Date: Sep 2009
Location: Near Orly airport
Hello,

"it had ugly LSB noise"
Because there is no reconstruction filter in this Rigol.
It's only raw data.
  Reply With Quote
Old 8th September 2013, 04:17 PM   #4
DF96 is offline DF96  England
diyAudio Member
 
Join Date: May 2007
A quick and dirty smoothing method is to replace each point by the average of itself and its two neighbours.

Any smoothing carries the risk of throwing away data so you need to know what you expect to see.
  Reply With Quote
Old 8th September 2013, 05:28 PM   #5
diyAudio Member
 
Join Date: May 2011
Location: Silicon Valley
Quote:
Originally Posted by DF96 View Post
A quick and dirty smoothing method is to replace each point by the average of itself and its two neighbours.
Yes, in fact that's the (degenerate case) Savitzky-Golay filter with N=0 {linear polynomial fit}, M=1 {window width = 1 point to the left and 1 point to the right of the fitted point}. Of course, selecting N=0 squanders all of the power of the S-G approach, which exactly matches the first N moments of the data.

I found a pretty nice paper by Shafer, 2nd author of the famous Oppenheim & Shafer DSP textbook which demystifies the S-G filter, by analyzing it in the frequency domain. Savitzky and Golay, chemists by profession, analyzed it only in the time domain. Nevertheless the fact that a couple of chemists devised an extremely useful FIR digital filter in 1964, is quite an achievement. As the jonsson.eu website says,

Quote:
The Savitzky—Golay smoothing filter was originally presented in 1964 by Abraham Savitzky [3] and Marcel J. E. Golay [4] in their paper Smoothing and Differentiation of Data by Simplified Least Squares Procedures, Anal. Chem., 36, 1627-1639 (1964) [2]. (Publicly available at Smoothing and Differentiation of Data by Simplified Least Squares Procedures. - Analytical Chemistry (ACS Publications).) Being chemists and physicists, at the time of publishing associated with the Perkin-Elmer Corporation (still today a reputable manufacturer of equipment for spectroscopy), they found themselves often encountering noisy spectra where simple noise-reduction techniques, such as running averages, simply were not good enough for extracting well-determined characteristica of spectral peaks. In particular, any running averaging tend to flatten and widening peaks in a spectrum, and as the peak width is an important parameter when determining relaxation times in molecular systems, such noise-reduction techniques are clearly non-desirable.
The S-G filter used in post #1 of this thread (blue raw DSO data -> S-G filter -> red smoothed data) had N=2 (cubic polynomial fit), M=11 (total window size = 23 points: 11 left, 1 center, 11 right). I got the coefficients from an S-G table on the web. Numerical Recipes gives source code to calculate the coefficients, for arbitrary N and M, but the ones I wanted were pre-calculated in a table.
  Reply With Quote
Old 27th September 2013, 04:59 PM   #6
diyAudio Member
 
Join Date: May 2011
Location: Silicon Valley
Eventually I decided that for the application I had in mind, presenting the raw data with visible DSO grunge was the best option. It throbs with the imperfect reality you see at the test bench. An example figure is below.

Here's the context of that figure, and a half dozen others.
Attached Images
File Type: png Grunge.png (78.5 KB, 26 views)
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Yet Another DSO Question jazbo8 Equipment & Tools 3 2nd May 2013 10:28 AM
Can a DSO be used to test riming quality of a digital data stream ? percy Equipment & Tools 12 11th May 2012 04:52 PM
DSO Nano or DSO Nano v2 Dr Zeus Equipment & Tools 4 2nd March 2012 03:07 PM
New DSO oscilloscopes - which one? anatech Parts 20 26th May 2007 10:33 AM
Saddam captured Prune The Lounge 33 31st December 2003 06:45 PM


New To Site? Need Help?

All times are GMT. The time now is 03:38 PM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright ©1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2