How to calculate moving Gradient feature of a signal?
4 次查看(过去 30 天)
显示 更早的评论
I want to calculate gradient feature (central difference) from my filtered data with window size=10samples and 50%overlap to previous window.
Here what i have done, i am adding here, and also attaching the image for central difference formula and dummy acceleration data. The issue is i am unable to add window overlap. I also can change the window size to bigger or smaller, not restricted to use just 10. How can do this writing either own code or using gradient function. Looking for kind help.
window=10samples
%Data_filtered is input signal
Grad =gradient(Data_filtered(1:window:end),window)
figure;
%"IMU_ULISS.time" is time
plot(IMU_ULISS.time(1:window:end),Grad)
%modified my time vector to plot it
time_modified=IMU_ULISS.time(1:window:end)
hold onplot(time_modified(ceil(find(IMU_ULISS.step_instant_target(1,:)>0)/window)),Grad(ceil(find(IMU_ULISS.step_instant_target(1,:)>0)/window)),'r');
hold on
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!