Closed henry2004y closed 4 years ago
I'm not sure there is a "correct" way to handle boundary conditions. We currently pad the signal with the endpoints here which is the same behaviour as mode=nearest
in scipy.signal.savgol_filter. It seems what @henry2004y is looking for is an interpolation option for extension.
I see. I agree that there's no correct way of handling this, and maybe in the end it doesn't matter that much to the final results. However, since Matlab and Python both implement interpolation as the default (or maybe only) option, I really hope it would be consistent also in Julia.
Thanks for the response!
Although I've wanted to clean up this implementation for a while so I could easily add the interpolation options. Changing issue title appropriately.
@henry2004y the PR ^^ should give you the behavior you expect for the boundaries.
Just a minor reminder about the typo of the function name:
Savitsky
-> Savitzky
Thanks @henry2004y! Should be in master now.
Oof! Thanks @henry2004y.
Hi,
I find that the savitzkyGolay() filter is not working properly on the boundary points.
Take this simple example, with first order polynomial and window size 5:
where the correct result should be x, but the corresponding function in Julia returns:
Hope there's a quick fix! Thanks!