Velocity data integration giving noisy results
Show older comments
Hello,
I'm trying to integrate velocity (using cumtrapz) data to get the displacement, but when I do so i get weird noise in the signal. I've filtered the velocity data and removed drift with the zero-phase filtering (filtfilt function), but it just doesn't seem to be right. Any ideas?
Cheers,
Cameron
4 Comments
dpb
on 28 Nov 2021
You'd have to attach the .mat file with the original data for anybody to be able to do anything -- and explain what is in it in a 3D array...
You can start, of course, by plotting the time histories to see what they look like...
Cameron Sprent
on 28 Nov 2021
Edited: Cameron Sprent
on 28 Nov 2021
dpb
on 28 Nov 2021
Something happens in your velocity between beginning and end of the trace...I didn't try to figure out where, but results I see look reasonable for the data as it is...there may yet be a very slight offset at the end although I didn't really investigate that much, either, after I saw the last frame of velocity data, didn't seem worth pursuing further until that is resolved -- if it is an issue -- if the input forcing is, in fact, step-valued, then I suppose it could be what it should be. With no idea what we're looking at/for, it's hard to say anything.
>> displ=cumtrapz(cropped_time,detrend(cropped_vel));
>> figure
>> plot(cropped_time,cropped_vel)
>> hold on
>> plot(cropped_time,displ)
>> xlim([20 20.1])
>> xlim([cropped_time(end)-0.1 cropped_time(end)])
>> close
>> figure
>> subplot(2,1,1)
>> plot(cropped_time,cropped_vel)
>> hold on
>> plot(cropped_time,displ)
>> xlim([20 20.1])
>> subplot(2,1,2)
>> plot(cropped_time,cropped_vel)
>> hold on
>> plot(cropped_time,displ)
>> xlim([cropped_time(end)-0.1 cropped_time(end)])

dpb
on 28 Nov 2021
Added another explantory graph --

Same results as the above for top figure except blown up displacement on RH axis. NB: the non-zero mean; detrending was applied over the full time trace; the mean for the first frame isn't zero as it doesn't match overal mean.
The second is applying detrend to the frame itself; then
>> mean(displ)
ans =
-7.5495e-06
>>
Answers (0)
Categories
Find more on Time Series Events in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!