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 for Programming
 Forum for Origin C
 Automated NLSF-sine - parameterproblem
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

AchimV

Germany
1 Posts

Posted - 09/09/2011 :  02:36:30 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. Pro 8 SR0
Operating System: WIN 7 Pro 64 Bit

Hey Guys,

I used the search-function but didn’t found a solution for the following problem:

I get a sine-signal from a movement measurement with a very low sampling rate. The frequency and the amplitude of the sine function are not constant but random. I try to get the best possible approximation to the signal.

My Idea is to use the nonlinear-curve-fitting-tool with sine-option for 3 cycles and automatically slide over the signal (about 1000 cycles). The function returns the amplitude and frequency values.
According to the quantity of cycles I tried to automate the analysis with Origin C but failed.

I found the following gaussamplitude-analysis example for origin c on the originlab webpage (http://originlab.com/index.aspx?go=Products/Origin/Programming/OriginC&pid=262 ) and replaced the NLSF.Func$ = “gaussamp”: with NLSF.Func$= “sine” but get a errormessage saying “Error! Parameter(s) xc, w, A, y0 is (are) not properly initialized. Check their values.”


void GaussianFit(string strCurve)
{
using NLSF = LabTalk.NLSF;	// Point to the NLSF object
NLSF.Init();			// Initialize the fitter
NLSF.Func$ = gaussamp";		// Assign fitting function
NLSF.Execute("parainit");	// Perform automatic parameter initialization
NLSF.FitData$ = strCurve;	// Assign dataset name
NLSF.Fit(100);			// Perform fit - up to 100 iterations
NLSF.PasteParams("p");		// Paste fit results to graph	
}


I thought “NLSF.Execute("parainit") “ would initialize the Parameters but it don’t works for the sine-analysis.
I would be glad if someone could help me with this sample-program or tell me how to implement the automated analysis on another way (LabTalk, X-Funktion???)

Achim



OriginPro 8 SR0
Windows 7 Pro - 64 Bit

Penn

China
644 Posts

Posted - 09/12/2011 :  11:25:33 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Achim,

The example you mentioned is using the LabTalk object, NLSF, which is obsolete. To perform fitting by using Origin C, you can refer to these Origin C examples.

Penn
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