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