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.
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.
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.
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.
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
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.