08-29-2013 06:00 AM
Hi all,
I'm having a bit of trouble doing some what calcuations on a signal aquired. The signal is a continous sine wave (from a position sensor) that has variable frequency and amplitude. What I'm trying to accomplish is to get extract each sine wave in my signal convert my signal from time domain to the angular position domain.
At the moment, I'm extracting a single sine wave from my signal (thanks to altenbach for the code), normalising it and trying to calculate the relative radial position at each time period of the sine wave.
I'm getting the expected output of+/- Pi/2 for a full rotation where as I would like to get the output to be 0 to 2Pi?
Cheers
08-29-2013 01:19 PM
DavidT,
It appears that there are (at least) two issues. The arcsine is defined for arguments from -1 to 1. Your data covers that range twice. So you need to keep track of which half cycle you are on. The other is an offset of pi/2 in the outout of the arcsine function.
I added a small constant times the iteration count to the arcsine in your VI to show that the range is covered twice.
Related to the first issue is that you are starting your cycles at zero while the arcsine range starts at -1. Cosines would be nicer but finding peaks is not so straighforward as zero crossings.
Since you know where your zero crossings occur, you may be able to keep track of which quadrant of the input cycle you are in and add the appropriate pi/2 multiple to the arcsine.
Lynn
08-30-2013 02:26 AM
Hi johnsold,
thanks for the reply. I will try a few of your suggestions.
As you mentioned, cosines would be better but I found peak detection to be a bit difficult. I tried by differentiating to find the points where rate of change of the curve equals 0, but data was much too noisy to get any decent results.
cheers!