I have some x and y (pixel) coordinates recorded by an eye-tracking device that were collected using a sensor that as not a steady Fs (sample rate) and want to apply a SGOLAY filter to my signal to remove noise and compute the velocity and acceleration of the movement.
I'm following the example in the Mathworks help secction regarding Savitzky-Golay Differentiation. But they use a predetermined fixed Fs can someone help me and explain how can I apply the filter for an variable Fs (I have the time of aquisition of each coordinate in seconds).
Adding more information I'm currently reading an article that states the following:
"In principle, this filter finds the polynomial function that best describes the raw data and differentiates the polynomial analytically to avoid adding noise. It then resamples the differentiated polynomial to the original sampling fre- quency. Applying the sgolay function in MATLAB, we can f ind a set of SG differentiation f ilters, which, given the raw gaze coordinates (xi, yi), output smoothed ve- locity (xi, yi) and acceleration (xi, yi) data for the x- and y-dimensions separately. Then the total angular velocity and acceleration are calculated as the Euclidean distance of the x- and y-components:
where PHI denotes a factor for converting from pixels to visual degrees. Velocity and acceleration data were ap- propriately adjusted to compensate for the time shift in- troduced by the filters."
I'm trying to apply this, algorythm.. but I'm dueling to understand what they are actually doing.. it looks like they are passing coordinates to the sgolay and they are given an output of component velocity/acceleration.