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 for Programming
 Forum for Origin C
 Automated NLSF-sine - parameterproblem

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
AchimV Posted - 09/09/2011 : 02:36:30 AM
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
1   L A T E S T    R E P L I E S    (Newest First)
Penn Posted - 09/12/2011 : 11:25:33 PM
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

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