[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: averaging/smoothing data

From: Allen.Windhorn
Subject: RE: averaging/smoothing data
Date: Wed, 13 Jul 2016 18:19:56 +0000


From: Help-octave [mailto:address@hidden On Behalf Of Przemek Klosowski

> Often, I need to smooth/average a data vector. I usually do a running
> average using filter(), e.g. for 5-value average:
>     filter(ones(1:5)/5,eye(5,1),x)
> I've been doing this for years, so I got used to it even though I have to
> think a little every time I need to do again, but maybe there's a better
> way? What do y'all use?

If you have "spiky" data it really helps to run it through a median filter
(signals package) before you do any linear filtering.

Yfilt = medfilt1(Y, n);

This gets rid of noise that only affects one reading, but doesn't affect
the shape of the signal very much.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]