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
 LabTalk Forum
 How to find the number of cycles? (origin 7.5)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

kumarb

India
7 Posts

Posted - 04/29/2011 :  12:02:17 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I have the dataset column which has the samples of sine wave.I need to find the cycles of the sine wave programmatically(either in origin c or labtalk)from the column values.The sine wave either start from 0 deg or 180 deg phase shift & it might have some straight/Ramp line in the beginning.
Kindly let me know the solution.



Kumar B

Penn

China
644 Posts

Posted - 05/02/2011 :  11:18:22 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Kumar B,

Maybe you can perform nonlinear fit on the data with the sine function to get the corresponding parameter of the sine function, and then you can calculate the cycle by using this sine function.

Penn
Go to Top of Page

miketeavey

United Kingdom
1 Posts

Posted - 05/05/2011 :  08:55:16 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Can't you simply traverse the x axis and count the number of times the y value is zero? The frequency is the number of zeros divided by two. I seem to remember doing something similar in Matlab some years back.
Go to Top of Page

kumarb

India
7 Posts

Posted - 05/09/2011 :  10:09:18 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by miketeavey

Can't you simply traverse the x axis and count the number of times the y value is zero? The frequency is the number of zeros divided by two. I seem to remember doing something similar in Matlab some years back.



Yes that method will work for simple sine wave.But my problem is the sine wave might have phase shift(we can't count the # times y-value is <=0) & some straight/Ramp line in the beginning of the cycle.



Kumar B
Go to Top of Page

thentangler

USA
Posts

Posted - 07/14/2011 :  5:56:35 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I too have a similar problem.
Is there a way to do it? Penn gave a very nice suggestion, but unfortunately there is no option to calculate the phase in the non linear fit.
Please help
Thank You
Go to Top of Page

couturier

France
291 Posts

Posted - 07/17/2011 :  04:19:02 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
How about some FFT, that will return frequency (max value of spectrum). The number of cycle can thereafter be found with the lenght of the signal.
Go to Top of Page

Stephen.herbert

USA
1 Posts

Posted - 08/02/2011 :  05:39:53 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Can not you just traverse the x axis and count the amount of moments the y worth is zero? The frequency may be the number of zeros divided by two. I appear to recollect undertaking something related in Matlab some ages again.

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