Effacer les filtres
Effacer les filtres

How to calculate moving Gradient feature of a signal?

6 vues (au cours des 30 derniers jours)
Muhammad Hammad Malik
Muhammad Hammad Malik le 16 Fév 2021
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

Réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by