How can i implement a butterworth filter in multiple files.

2 views (last 30 days)
Hi everyone,
For our programming exam we have to implement a butterworth filter on the markers of a 3d camera (biomechanics). The files consist of the x,y and z coördinates of the markers and are stored in a map data. In the map are subfolders for each subject and per subject we have the markers.
% butterworth filter for the Videosignals [b,a]=BUTTER(N,Wn,ftype)
% N = orde van de filter = 4
% Wn = cutoff frequentie = 6hz/(0.5*VideoFrameRate)
% ftype = type filter = lowpass
[b,a]=butter(4,0.12,'low');
When i try to use the filter on all of the files I get the error that all my subscript indices must be either real positive or logical.
this is what I came up with:
teller1=teller1+1;
videosta.(sprintf('v_sta%c',num2str(teller1)))=...
VideoSignals(:,[stair_markers.RKNE, stair_markers.RANK, stair_markers.RASI, stair_markers.RPSI, stair_markers.RHEE, stair_markers.LKNE, stair_markers.LANK, stair_markers.LASI, stair_markers.LPSI, stair_markers.LHEE, stair_markers.STRN], [1,2,3]);
videosta.(sprintf('v_sta_filt%c',num2str(teller1)))=...
filtfilt(b,a,videosta.(sprintf('v_sta%c',num2str(teller1))));
where videosta is for markers in our stair trial, we also have a sit to stand trial.
I really have no clue of what to do with this error. And I hope someone can help me with the things described here.
Kind regards

Answers (0)

Community Treasure Hunt

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

Start Hunting!