02-05-2013 09:26 AM
I have some confusion on the numerical integration. I have sinusoidal data from an accelerometer and want to double integrate to get displacement. From my understanding the integral of sin X should be -Cos X, but there seems to be some other factor creeping into this. Am I just doing something wrong here? The files give the input data, a snippet of the code and the output I get when I run the snippet.
02-05-2013 09:52 AM
Mitch_cottrell,
Your data has a DC offset and it also gets integrated, producing the ramp and quadratic effects you see. Look at XY Graph on the first image you posted. The positive peaks exceed 0.01 while the negative peaks never reach -0.01. Therefore at DC offset of about 0.001-0.002 appears to exist.
Also your data set does not include an exact integer number of cycles of the sinusoidal signal. The partial cycle also adds to (or subtracts from) the offset.
Subtracting the mean of the dataset before integrating will help.
Lynn