필터 지우기
필터 지우기

How to calculate moving Gradient feature of a signal?

조회 수: 6 (최근 30일)
Muhammad Hammad Malik
Muhammad Hammad Malik 2021년 2월 16일
편집: Muhammad Hammad Malik 2021년 2월 16일
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개)

카테고리

Help CenterFile Exchange에서 Smoothing and Denoising에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by