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
 Savitzky-Golay-Smoothing with 800 curves
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

centax

3 Posts

Posted - 02/03/2011 :  2:49:50 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi everybody,

i want to use the Savitzky-Golay-Filter on a worksheet with 1 X axis and 800 y axes. is it possible to smooth all 800 curves at once? and when yes: how? :)
thanks a lot

Version: OriginPro 8.50G SR1
OS: Windows 7

vincenth

30 Posts

Posted - 02/07/2011 :  12:27:48 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

The easiest way is to loop over all the columns using a script:

int numcols = wks.ncols;
for (ii=2; ii<=numcols; ii++) {
smooth iy:=Sheet1!$(ii) method:=sg npts:=4 polyorder:=2 oy:=Sheet2!<new>;
}

Highlight the entire script in the script window and hit enter to run it. The script above assumes you have your input data in Sheet1, with X data in column 1, and n Y data columns to the right. The output data is sent to Sheet2, and will create a new X for each. If you only care about generating new Y columns, the following will work:

int numcols = wks.ncols;
for (ii=2; ii<=numcols; ii++) {
smooth iy:=Sheet1!$(ii) method:=sg npts:=4 polyorder:=2 oy:=Sheet2!(<autoX>,<new>);
}

Regards,
Vince
Go to Top of Page

centax

3 Posts

Posted - 02/09/2011 :  09:43:54 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
thanks a lot! it works :)
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