Data smoothing algorithms?

Charles Krug cdkrug at worldnet.att.net
Fri Apr 29 23:56:19 EDT 2005


"Anthra Norell" <anthra.norell at tiscalinet.ch> writes:
> 
>> Hi,
>> 
> The following are differences of solar declinations from one day to
> the next, (never mind the unit). Considering the inertia of a
> planet, any progress of (apparent) celestial motion over regular
> time intervals has to be highly regular too, meaning that a plot
> cannot be jagged. The data I googled out of Her Majesty's Nautical
> Almanac are merely nautical precision and that, I suppose, is where
> the jitter comes in. There's got to be algorithms out there to iron
> it out. If it were a straight line, I could do it. But this, over
> the whole year, is a wavy curve, somthing with a dominant sine
> component. Suggestions welcome.
> 

Anything you do to your samples is going to distort the samples, either
in frequency or in time.

Luckily for you, all of the interesting information in your signal is in
the time domain representation, unless you consider a
3.1709791983764586504312531709792e-8Hz sinusoid interesting.

A simple moving average filter is often helpful in these cases, along
with being the Simplest Possible Thing That Might Work.

Take a look at: http://www.dspguide.com/pdfbook.htm
"The Scientist and Engineer's Guide to DSP," which is well regarded by
the denizens of comp.dsp.

Check out Chapter 14 for an overview, and 15 for moving average filters.

You can also try a single-pole recursive filter with a cutoff of 1/360
of your sample rate, but that slightly more complicated.

Try the moving average first.  It's the simplest and very often Good
Enough.





More information about the Python-list mailing list