When I load my Data from excel and calculate the xr, my result is correct. When I load only Time and Acceleration from excel, integrate with cumtrapz for Velocity and Displacement and then calculate the xr, my result is wrong (inaccurate).

Update: I should also mention that before integration (whether using time or frequency domain techniques), I will typically remove any linear/constant trends in my data using the DETREND function. This removes the amplitude at DC (or zero-frequency) and any other relatively low-frequency noise introduced/boosted by performing the integration.

Direct link to this comment

You need to run the DETREND tool on the acceleration data first. Something like:

x1ddot = xlsread('Data','B2:B2501'); % Acceleration (m/s^2)

x1ddot_detrend = detrend(x1ddot);

x1dot = iomega(x1ddot_detrend,0.0180,3,2); % Velocity (m/s)

x1 = iomega(x1ddot_detrend,0.0180,3,1); % Displacement (m)

x2ddot = xlsread('Data','E2:E2501'); % Acceleration (m/s^2)

x2ddot_detrend = detrend(x2ddot);

x2dot = iomega(x2ddot_detrend,0.0180,3,2); % Velocity (m/s)

x2 = iomega(x2ddot_detrend,0.0180,3,1); % Displacement (m)

Note: You can place the detrended acceleration data inside the function for outputting both the velocity and displacement data (just change the input/output data types as shown). You may also need to run a high-pass filter to get rid of other low-frequency noise.

Other Note: Even after detrending and filtering produces a good match to the shape of the output velocity/displacement data, there will still be some bulk shift that will need to be applied for better alignment. Always some unknown constant ("C") that you may need to add on to your result after integration.

This website uses cookies to improve your user experience, personalize content and ads, and analyze website traffic. By continuing to use this website, you consent to our use of cookies. Please see our Privacy Policy to learn more about cookies and how to change your settings.