This Matlab function performs a residual analysis of some MoCap data (or similar digital data). The residual can be used to determine the frequency content of the given data and a reasonable cut-off frequency. The input data should have a length of more than twice the used filter length <res> due to the filtering process. See [1] and [2] for more information about this method and the interpretation of the residual result.
[1] Skogstad, S. et al., Filtering Motion Capture Data for Real-Time Applications, In proceedings of NIME (2013)
[2] Winter, D.A., Biomechanics and Motor Control of Human Movement, John Wiley & Sons (2009)