Filtering MoCap Data for Real-time Applications

In this project, we have examined best practice methods for filtering MoCap data for real-time applications, i.e., the potential for using low group delay filters and their appropriate design methods.

Image may contain: Rectangle, Font, Parallel, Circle, Magenta.

We have implemented an alternative filter design method based on multi-objective optimization to target this challenge. With this method, we have thoroughly compared different design methods and designed nearly optimal filters with arbitrary specifications that compare favorably to existing filters in the literature. Additionally, to create filters specific to our applications, we have experimented to determine the frequency specifications of MoCap data. Finally, based on these tools and results, we have proposed a range of filters suitable for real-time MoCap applications.


Motion capture (MoCap) and sensor technologies are seen used in real-time interactive applications, such as computer game controllers (e.g., Wii Remote, PlayStation Move, Kinect) and other gestural controllers (e.g., new musical interfaces, mobile phones, novel interfaces for desktop computer). The increased availability of new and improved MoCap technologies, together with algorithms that interpret user motion as control data, make it increasingly affordable and feasible to use for musical interaction. However, most of the utilized MoCap technologies are known to possess noise properties that may be problematic [1, 2]. Therefore, applying filters to alter these noise problems is often necessary. And, as one might expect, there will always be a corresponding delay penalty when employing a digital filter. It is, therefore, relevant to consider filters with low group delay for applications that demand good real-time performance [3].

Two main digital filter types exist finite impulse response (FIR) filters and infinite impulse response (IIR) filters. Essentially, IIR filters offer an effective way of achieving a long impulse response without having to use long FIR filters. Therefore, if the goal is to minimize the time delay, the use of IIR filters seems reasonable since they can have a dramatically lower order than FIR filters with similar performance [4]. Our results in [a] support this claim as well. However, no established method exists for designing IIR filters with minimal group delay. Additionally, there is little literature concerning best practice methods for filtering MoCap data for real-time applications. The goal of the current project has therefore been to target these challenges.

Image may contain: Rectangle, Font, Parallel, Circle, Magenta.

The outcome of the project

  • Implemented an alternative filter design method
    We proposed and implemented an alternative filter design method based on multi-objective optimization. With this method, we can find nearly optimal IIR filters with arbitrary specifications [a][b].
  • Explored low delay filter design methods (low group delay)
    Based on the above method, we have scoured the potential of designing filters with low group delay [a]. In short, it was shown that filter delay is a trade-off with noise attenuation. Furthermore, our method found more optimal low delay filters than the currently available design methods can produce [a].
  • Designed IIR low-pass differentiators (of degrees 1 and 2)
    With the above design method, we have been able to design low-pass differentiators that compare favorably with existing differentiators in literature [b]. Low-pass differentiators are especially relevant for us since they avoid the undesirable amplification of noise in the higher frequency band, which is characteristic of MoCap data [b]. We have also been able to custom design low-pass differentiators of degree two (non-cascaded), which is not found presented earlier in the literature. (Using one differentiator of degree 2 is equivalent to using two differentiators of degree 1 in cascade. However, the former will generally give a more optimal solution.)
  • Implemented a frequency content analyzer method
    We have implemented a method for analyzing the frequency content of MoCap data and proposed an approach for interpreting these data to determine reasonable frequency cutoffs, i.e., which frequencies a filter should filter out. This method is also relevant when designing filters for post-processing of MoCap data, i.e. when real-time features are insignificant [c].
  • Found generic frequency properties of hand motion
    We have further experimented to find the generic frequency properties of free hand motion. Here we recorded the hand motion of 20 subjects, which were then analyzed with the above analysis method. Based on this experiment, we have proposed three cutoff frequencies for different scenarios and filtering needs: 5, 10, and 15 Hz, which relate to heavy, medium, and light filtering, respectively [c]. The 5 Hz and partly the 10 Hz cutoff will attenuate some high-frequency parts of rapid hand motion. However, this may be necessary to get the needed noise suppression [c].
  • Proposed a set of filters for filtering MoCap data for real-time applications
    Finally, we have proposed a set of appropriate filters for real-time MoCap applications for filtering hand motion data, both low-pass filters and low-pass differentiators of degrees 1 and 2, based on the frequency properties found above and our proposed filter design method [c]. These filters are presented below.

Available tools/software

Max/MSP IIR MoCap filter patch

The above-mentioned IIR filters are implemented in the following MAX / MSP patch. See the guidelines in [c] to choose a suitable cut-off frequency or use the following analysis method. (The specification of these filters are given at the end of this page.)

Frequency analysis of MoCap data with the residual analysis

The residual analysis was the best method for determining the frequency content of MoCap data and can be used to determine a reasonable cut-off frequency [c]. The technique consists of low-pass filtering the data with different cutoff frequencies and calculating the residual, i.e., what is left over when we subtract the filtered data from the raw data. As long as the filter only attenuates noise, the residual should be relatively small. However, the residual will become more prominent when the filter attenuates the desired signal. We get an overall picture of their impact by performing this analysis for several cutoff frequencies and plotting the resulting residuals. This plot can then serve as a basis for determining a reasonable cutoff frequency [2]. See the included help file or [c] for more information about this method. The function is written in Matlab and should work in most Matlab versions. 

The proposed real-time IIR filters

Below we have given the transfer functions of the proposed IIR filters. These are the same filters embedded in the above Max/MSP patch. All filters have a group delay of 2 samples or less and have better low-delay performance than what currently established filter design methods can create [b] (between 5 and 16 dB noise attenuation gain compared to comparable FIR filters). The transfer functions can be used with the filter method in Matlab. For C++ implementation, see [5] or similar programming literature. Notice that it is more optimal to use one low-pass differentiator of degree 2 instead of two subsequent low-pass differentiators in cascade.

Transfer functions for IIR low-pass filters
Normalized cut-off frequency b0 / a0 b1 / a1 b2 / a2 b3 / a3 b4 / a4
0.1 0.1400982208 -0.0343775491 0.0454003083 0.0099732061 0.0008485135
  1 -1.9185418203 1.5929378702 -0.5939699187 0.0814687111 
0.2 0.1526249789 0.0333481282  0.0777551903  0.0667145281  0.0138945068
  1 -1.7462227354  1.7354077932 -0.8232679111  0.1793463694
0.3 0.1851439645  0.1383283833  0.1746892243  0.1046627716  0.0464383730
  1 -1.2982434912 1.4634092217 -0.7106501488  0.2028836637
0.4 0.2680960849  0.5174415712  0.5839923942  0.3748650443  0.1199394960
  0.0324610402  0.7694515981 -0.0071430949 0.0714586993
0.5 0.3730569536 0.8983119412 0.9660856693 0.5189611913 0.1099005390
  1  0.8053107424 0.8110594452 0.2371869724 0.0849291749


Transfer functions for IIR low-pass differentiators of degree one
Normalized cut-off frequency b0 / a0 b1 / a1 b2 / a2 b3 / a3 b4 / a4
0.1 -0.1543174259 0.1742393427  -0.0178886989 -0.0022975713 0.0002643535
  1 -2.057494776  1.858705877 -0.801785135 0.131076358
0.2 0.1973679432 -0.0056567353 -0.0321850947 -0.1099445540 -0.0495815592 
  1 -0.9870779094 0.7774863652  -0.2206843188 0.02813441289
0.3 0.2712475020   0.1323672597  -0.0487267360   -0.1783422292 -0.1765457966 
  1  -0.2919477037  0.5104653639  -0.01557831719 0.000283848732
0.4  -0.3453135426   -0.1914474803  0.0747940184  0.2519130203  0.2100539842
   -0.09449724871  0.7354550061 -0.1362890086  0.075249263
0.5 -0.4565845496 -0.3412669800  0.1339011848 0.4087476487 0.2552026961
  1  0.4053572816 0.7861200479  -0.01658829946 0.103079108


Transfer functions for IIR low-pass differentiators of degree two
Normalized cut-off frequency b0 / a0 b1 / a1 b2 / a2 b3 / a3 b4 / a4
0.1 -0.0738989849  0.1351624829  -0.0512998379  -0.0072918334  -0.0026718267
  1 -1.628286742  1.418759018 -0.6223424612  0.1085280231
0.2 -0.0795571277  0.1390709784 -0.0479192600 -0.0031459045 -0.0084486862 
  1 -1.571029458  1.459212744  -0.7173743414  0.1488005975
0.3 0.1099156485  -0.1289124440  -0.0372667405  0.0216082189   0.0346553170
  1 -0.8274946715 0.8110775672 -0.3530877871 0.06598917583
0.4 0.1395922313  -0.1222824625  -0.0923902820 -0.0067409738 0.0818214870 
   -0.3633175924  0.6359593486   -0.2984125636 0.06773100371
0.5 0.2032072414  -0.0963599828  -0.2483531617 -0.0270426939  0.1685485970
  1  0.6158413681  0.5207334231 -0.003833685163 0.01809833326


[a] Skogstad, Ståle A. and Holm, Sverre and Høvin, Mats, Digital IIR Filters With Minimal Group Delay for Real-Time Applications, The International Conference on Engineering and Technology (2012) 

[b] Skogstad, Ståle A. and Holm, Sverre and Høvin, Mats, Designing Digital IIR Low-Pass Differentiators With Multi-Objective Optimization, IEEE Computer Society (2012)

[c] Skogstad, Ståle A. and Nymoen, Kristian and Holm, Sverre and Høvin, Mats and Jensenius, Alexander Refsum. Filtering Motion Capture Data for Real-Time Applications, In Proceedings of NIME (2013)


  1. S. A. Skogstad, K. Nymoen, and M. Hovin, “Comparing inertial and optical mocap technologies for synthesis control,” in Proc. Sound and Music Computing, 2011.
  2. D. Winter, Biomechanics and Motor Control of Human Movement. John Wiley & Sons, 2009.
  3. D. Wessel and M. Wright, “Problems and prospects for intimate musical control of computers,” in Proc. NIME, (Seattle, USA), 2001.
  4. S. Mitra, Digital signal processing: a computer based approach. McGraw-Hill H. E., 2005.
  5. W. Press, Numerical Recipes 3rd Edition: The Art of Scientific Computing. Numerical Recipes: The Art of Scientific Computing, Cambridge University Press, 2007.
  6. H. Woltring, “On optimal smoothing and derivative estimation from noisy displacement data in biomechanics,” Human Movement Science, no. 3, 1985.
  7. G. Wood, “Data smoothing and differentiation procedures in biomechanics,” Exercise and sport sciences reviews, vol. 10, no. 1, p. 308, 1982.
  8. D. Robertson, Research Methods in Biomechanics. Human Kinetics, 2004.
Tags: MoCap, filters, low group delay, minimum group delay, real-time applications, real-time filters By Ståle A. Skogstad
Published July 28, 2022 11:36 PM - Last modified Aug. 9, 2022 9:14 PM