[SciPy-Dev] Faster implementation of the Savitsky-Golay filter.

Ralf Gommers ralf.gommers at googlemail.com
Tue May 4 20:13:44 EDT 2010


On Sun, May 2, 2010 at 7:36 PM, Davide Lasagna <lasagnadavide at gmail.com>wrote:

> Hi all,
>
> I have come up with a much faster implementation of the Savitsky-Golay
> filter function proposed in the Cookbook at
> http://www.scipy.org/Cookbook/SavitzkyGolay.
>
> I have tweaked the code in the cookbook and removed the two loops at the
> end of the function with a call to np.convolve. The speed up is in excess of
> a hundred.
>
> I have attached the code. Can someone update the relevant scipy wiki page?
>

You can update that page yourself, it's a wiki. You just need to register
first.

>
> Moreover, is there a chance that such function will be part of scipy?
>

This would be a very useful addition I think. It would need tests, a more
informative docstring that conforms to the numpy standard and reformatting
to keep the lines shorter than 80 chars. Where it could go I'm not sure,
probably scipy.interpolate or scipy.signal.

In the cookbook page it is stated that "A much better solution would be to
extend the signal with its mirror image." Did you consider the
implementation given?

Cheers,
Ralf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20100505/ea6a442f/attachment.html>


More information about the SciPy-Dev mailing list