Applying sgolay filter (derivatives) on data with variable Fs
Show older comments
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.
1 Comment
Natalie St. John
on 16 Jun 2020
Hi! I unfortunately can't help you with your question regarding variable frequencies. However, I'm also using the methods in the Nystrom & Holmqvist 2010 paper to classify saccades and fixations from gaze coordinates. I have one note: in the second function you posted (for acceleration), shouldn't you multiply by the frequency squared, since it is the 2nd derivative?
Accepted Answer
More Answers (0)
Categories
Find more on Smoothing and Denoising in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!