From: ofer halperin on
hello
i wonder if someone can help me?
im using the savitzky-golay to smooth time series and to look on the derivative.
i compere the result to ather program and over there there is an option to set passes when, "Passes field specifies the number of sequential applications of the smoothing filter. In general, three passes is about optimum". when i compere it to the matlab sgolay smoothing, for 1 passes it was perfect, but in compertion to 3 passes it was'nt the same result. i dont have experience in this area, but, with 3 passes i got better result. can anyone tell me what the passes means and how can i set this option in matlab sgolay algoritem?.
thanks
From: Wayne King on
"ofer halperin" <aofer.halperin(a)mail.huji.ac.il> wrote in message <i0um01$gcp$1(a)fred.mathworks.com>...
> hello
> i wonder if someone can help me?
> im using the savitzky-golay to smooth time series and to look on the derivative.
> i compere the result to ather program and over there there is an option to set passes when, "Passes field specifies the number of sequential applications of the smoothing filter. In general, three passes is about optimum". when i compere it to the matlab sgolay smoothing, for 1 passes it was perfect, but in compertion to 3 passes it was'nt the same result. i dont have experience in this area, but, with 3 passes i got better result. can anyone tell me what the passes means and how can i set this option in matlab sgolay algoritem?.
> thanks

Hi Ofer, are you sure it isn't as simple as applying the Savitzky-Golay filter successively to the output of the previous filtering operation? That's what this description sounds like:

"Passes field specifies the number of sequential applications of the smoothing filter. In general, three passes is about optimum".


load mtlb % Load data
smtlb = sgolayfilt(mtlb,3,41); % Apply 3rd-order filter (1st pass)
smtlb2 = sgolayfilt(smtlb,3,41); % 2nd pass
smtlb3 = sgolayfilt(smtlb2,3,41); % 3rd pass
plot(smtlb,'k'); hold on;
plot(smtlb3,'b','linewidth',2);

Wayne
From: nor on
Hi Wayne,

I just wonder if MATLAB has changed the function savgol to sgolayfilt? It works the same way right?

Many thanks
Nor
From: Wayne King on
"nor " <nanadilla(a)yahoo.com> wrote in message <i1276g$lc2$1(a)fred.mathworks.com>...
> Hi Wayne,
>
> I just wonder if MATLAB has changed the function savgol to sgolayfilt? It works the same way right?
>
> Many thanks
> Nor

Hi Nor, savgol is not a Mathworks function.

That function appears in this toolbox:

http://www.maths.lth.se/matstat/wafo/documentation/wafodoc/index.html

Not sure if that is the one you are talking about.

Wayne
From: nor on
"Wayne King" <wmkingty(a)gmail.com> wrote in message <i1284g$mvb$1(a)fred.mathworks.com>...
> "nor " <nanadilla(a)yahoo.com> wrote in message <i1276g$lc2$1(a)fred.mathworks.com>...
> > Hi Wayne,
> >
> > I just wonder if MATLAB has changed the function savgol to sgolayfilt? It works the same way right?
> >
> > Many thanks
> > Nor
>
> Hi Nor, savgol is not a Mathworks function.
>
> That function appears in this toolbox:
>
> http://www.maths.lth.se/matstat/wafo/documentation/wafodoc/index.html
>
> Not sure if that is the one you are talking about.
>
> Wayne

Thank you. Yes, that is the function that I meant. However, now it disappear from MATLAB. I can no longer use it. The sgolay and sgolayfilt functions somehow operate differently.

I have a matrix that contains about 2000 NIR spectra. I need to perform smoothing and first derivate to the spectra. Previously I used the savgol function. Now since it disappear, I am at lost. Any help?

Thanks
Nor
 |  Next  |  Last
Pages: 1 2
Prev: read mat file in C++
Next: read mat file in C++