You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please see here. Apparently the implementation of the SG filter from Qlab is not fully correct. I check with yours here and I got the following:
julia> x = [1,2,3,4,5,6,7,8,9,10]
julia>SavitzkyGolay(x, 0, 1, 5)
1×10 LinearAlgebra.Adjoint{Float64,Array{Float64,1}}:1.22.03.04.05.06.07.08.06.85.4
It seems that the SG should produce the same input x for this case. I checked with Matlab sgolayfilt and it does give [1,2,3,4,5,6,7,8,9,10]. Looks like the edges are distorted. In the Qlab implementation we have the same problem:
I've been having a bugger of a time with Sgolay, using DSP.jl broke my package a few weeks ago, and I had to write my own Conv1D function etc.
Yes the edges do appear distorted relative to Matlabs implementation. The tricky part is this, savitsky golay loses information at the edges by doing the convolution, it's inevitable. Basically it's an FIR filter if I recall correctly. So some implementations, I think, enforce different boundary conditions, IE: mirror, repeating, set to 0, etc. I haven't looked at your example yet - but I can try to make it match more closely to matlab if you want.
Yeah, it was someone who actually posted that the data filter did not match that one from Matlab's. But, in any case, are just the edges, as you said. I actually found another SG implementation a bit old, using generated functions, that has the same issue.
Hi there,
Please see here. Apparently the implementation of the SG filter from Qlab is not fully correct. I check with yours here and I got the following:
It seems that the SG should produce the same input
x
for this case. I checked with Matlabsgolayfilt
and it does give[1,2,3,4,5,6,7,8,9,10]
. Looks like the edges are distorted. In the Qlab implementation we have the same problem:The text was updated successfully, but these errors were encountered: