The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Differentiation using Savitzky-Golay Smoothing
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

albertguo

China
Posts

Posted - 11/07/2008 :  11:59:47 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I found that originlab8.0 didn't have the function of 'Differentiation using Savitzy-Golay Smoothing'. When I use labtalk to call the function, it is insensitive to the smooth points setting. it always return the same results for any smooth point setting. How to deal with this in originlab8.0?

Deanna

China
Posts

Posted - 11/09/2008 :  10:49:45 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Albert,

I did some testing in Origin SR4. Looks like the smooth point option can work.

Below is the script I used to do the testing:

//Create a new book and import the data
newbook;
string fname$ = system.path.program$ + "Samples\Signal Processing\fftfilter1.dat";
impasc;
wks.addcol();
wks.addcol();

//smoothing points = 10
col(c)[c]$=10-point;
curve.data$ = %h_b;
curve.result$ = %h_c;
curve.i1 = -1;
curve.smoothpts = 10;
curve.derivdeg = 1;
curve.polyDeg = 2;
curve.derivdeg = 1;
curve.sgderiv();

//smoothing points = 5
col(d)[c]$=5-point;
curve.data$ = %h_b;
curve.result$ = %h_d;
curve.i1 = -1;
curve.smoothpts = 5;
curve.polyDeg = 2;
curve.derivdeg = 1;
curve.sgderiv();


I can see column C and column D is different with different smoothpts setting. Would you pleae try again?

Also, in the coming SR5, we will add the Savitzy-Golay Smoothing method to the Differentiate tool so that you can use it from GUI.

Deanna
OriginLab Technical Services

Edited by - Deanna on 11/10/2008 10:43:03 PM
Go to Top of Page

albertguo

China
Posts

Posted - 11/10/2008 :  8:27:16 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you Deanna!
I use the curve.smoothleftpts and curve.smoothrightpts to set the smoothing points. It does not work. The script looks like the following:

curve.reset();//initialize the curve object.
curve.data$=%(rawdatasheet$)_raw;
curve.result$=%(rawdatasheet$)_deriv1st;
curve.smoothleftpts=10;
curve.smoothrightpts=10;
curve.derivdeg=1;
curve.sgderiv();
Go to Top of Page

Deanna

China
Posts

Posted - 11/10/2008 :  10:41:21 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

sorry I made a mistake in last reply. So I am editing this reply.

curve.smoothLeftPts and curve.smoothRightPts can work with the curve.sgderiv(); method. But we have to set the curve.smoothpts in the mean time. You can add the follwing line after you set left points and right points:

curve.smoothpts=curve.smoothleftpts + curve.smoothrightpts + 1;


A complete example (suppose the souce data is in column B):

curve.data$=%h_B;
curve.result$=%h_c;
curve.smoothleftpts=2;
curve.smoothrightpts=3;
curve.smoothpts=curve.smoothleftpts + curve.smoothrightpts + 1; 
curve.polyDeg = 2;
curve.derivdeg = 1;
curve.sgderiv();



Deanna
OriginLab Technical Services

Edited by - Deanna on 11/13/2008 3:57:20 PM
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000