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
 All Forums
 Origin Forum
 Origin Forum
 Differentiation using Savitzky-Golay Smoothing

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
albertguo Posted - 11/07/2008 : 11:59:47 PM
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?
3   L A T E S T    R E P L I E S    (Newest First)
Deanna Posted - 11/10/2008 : 10:41:21 PM
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
albertguo Posted - 11/10/2008 : 8:27:16 PM
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();
Deanna Posted - 11/09/2008 : 10:49:45 PM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000