You are on page 1of 4

ARTICLE IN PRESS

Journal of Biomechanics 40 (2007) 678681 www.elsevier.com/locate/jbiomech www.JBiomech.com

Short communication

A general solution for the time delay introduced by a low-pass Butterworth digital lter: An application to musculoskeletal modeling
Kurt Manala,, William Roseb
a

126 Spencer Laboratory, Center for Biomedical Engineering Research, University of Delaware, Newark, DE 19716, USA b College of Health Sciences, University of Delaware, Newark, DE 19716, USA Accepted 2 February 2006

Abstract Low-pass Butterworth digital lters are commonly used in biomechanics-related research. In general, the input signal is ltered in the forward and reverse directions so that a temporal shift in the output signal does not occur. There are times, however, when introducing a specic time delay is an important consideration when modeling a physiological event. Filtering the data in the forward direction only can be used as an efcient method to account for a specic time delay. Specic delays are possible by carefully selecting the lter order and cut-off frequency. The purpose of this paper is to present the analytical formulation of a general solution for the time delay introduced by a low-pass Butterworth digital lter. r 2006 Elsevier Ltd. All rights reserved.
Keywords: Signal; Processing; Smoothing; Electromechanical delay; Group delay

1. Introduction Butterworth lters can be used to remove high frequency noise present in data collected using highspeed video, force platforms, accelerometers, and strain gauges (Winter, 1990). A low-pass Butterworth lter allows sinusoids with frequencies lower than a specied cut-off, fc, to pass through the lter unaffected, while sinusoids with frequencies greater than fc are severely attenuated and effectively eliminated from the output signal. Although the effect of low-pass ltering a signal is familiar, the effect on timing is less obvious. In general, the output signal is a somewhat delayed version of the input signal. This is because a causal low-pass lter with a xed order and cut-off frequency will delay sinusoids of different frequencies by different amounts. This is an undesirable yet unavoidable effect of ltering, and is not limited to Butterworth lters.
Corresponding author. Tel.: +1 302 831 4463; fax: +1 302 831 3466. E-mail address: manal@udel.edu (K. Manal).

The time delay can be corrected by re-ltering the already ltered data in the reverse direction. Dualpass ltering the data introduces an equal and opposite time delay, thereby realigning the output and input signals in the time domain. There are certain instances when it may be necessary to include a specic time delay when modeling a physiological event. For example, the delay between a noticeable increase in EMG and a rise in the measured force (i.e., electromechanical delay) is an important consideration when using an EMG-driven musculoskeletal model (Heine et al., 2003). Electromechanical delay is accounted for by dual-pass ltering the EMG and then temporally shifting it relative to the experimentally measured force data (Manal et al., 2002; Lloyd and Besier, 2003). A more efcient method would be to lter the EMG data in the forward direction only using lter parameters that would shift the signal the desired amount. The purpose of this paper is to present a general solution for approximating the time delay introduced by a low-pass Butterworth digital lter as a function of cutoff frequency and lter order. An example using EMGs

0021-9290/$ - see front matter r 2006 Elsevier Ltd. All rights reserved. doi:10.1016/j.jbiomech.2006.02.001

ARTICLE IN PRESS
K. Manal, W. Rose / Journal of Biomechanics 40 (2007) 678681
BUTTERWORTH FILTER DELAY 1.6 1.4 NORMALIZED DELAY ( d * fc ) 1.2 1.0 0.8 0.6 0.4 0.2 0.0 0.0 0.5 1.0 1.5 2.0 NORMALIZED FREQUENCY ( f / fc ) N=8 N=5 N=4 N=3 N=2

679

Fig. 1. Time delay versus frequency for low-pass Butterworth lters of order, N 2, 3, 4, 5 and 8. Normalized frequency (i.e. the actual frequency of an input sinusoid divided by the lter cut-off frequency in Hertz) and normalized delay (i.e. actual delay in seconds multiplied by the lter cut-off frequency in Hz) are plotted. For example, if the input is 150 Hz and the lter cut-off frequency is 100 Hz, then the normalized frequency (f/fc) of the input is 1.5. If the lter order is N 8, the corresponding normalized delay (delayfc) indicated on the graph is 0.45. The actual delay is 0.45/ 100 Hz 0.0045 s. Note how the delay for any given lter order approaches a constant value as the normalized frequency approaches zero.

recorded from the soleus during an isometric plantarexion exercise is presented to demonstrate how this method can be used within the framework of musculoskeletal modeling.

2. Methods 2.1. Analytic formulation Let X(f) and Y(f) be the frequency-domain representations of the input and output signals, respectively, of a lter. For a linear lter,1 the input and output signals are related by a transfer function H(f): Y f H f X f . (1)

p where i 1. Coefcient a0 1. Coefcients a1 to aN can be generated using mathematical software such as Matlabs. The delay, dN(f), associated with a Butterworth lter of order N is calculated by substituting the right-hand side of Eq. (3) for H(f) in Eq. (2). The subsequent lengthy derivation has been omitted for sake of clarity. Eq. (4) is the resulting expression as a function of frequency measured in cycles/s:
N 1 P

p2i 2pf 2i , (4)

d N f where p2 i
i X j 0

i 0

1 f =f c 2N

If H(f) is known, then the frequency-dependent delay, d(f), can be calculated: 1 d d f FH f , 2p d f (2)

1j 2j 1aij aij 1 ,

(5)

where F(H(f)) is the phase of H(f). An analog low-pass Butterworth lter of order N has a transfer function H N f 1 , a0 a1 i2pf aN i2pf N (3)

1 For a denition of linear, see Oppenheim and Schafer, 1975, chapter 1.

and the aks are the lter coefcients in Eq. (3), with ak 0 for k4N . The delay functions plotted in Fig. 1 were created using Eq. (6). The delay functions are nearly at (i.e., independent of frequency) near the Y-axis as f/fc approaches zero. At frequencies near the cut-off, the delay is larger than the zero-frequency value, and at frequencies well above the cut-off, the delay is smaller. For simplicity, a single number to approximate the delay for a given lter order and cut-off frequency is preferable to a function. We choose the zero-frequency value as an approximate delay associated with a

ARTICLE IN PRESS
680 K. Manal, W. Rose / Journal of Biomechanics 40 (2007) 678681

particular lter order and cut-off frequency. The delay at zero frequency can be computed from Eq. (4) by setting f 0, which results in d N f 0 p0 , where p0 a0 a1 a1 . (7) (6)

delay 0.615/fc for N 6. Therefore we set 0.015s 0.615/fc, and solve to get f c 41 Hz. 2.2. Experimental verication EMGs were recorded from the soleus muscle of one subject during a maximal effort plantar exion exercise on a Biodex dynamometer. The knee was positioned in 1001 of exion and the ankle in 151 of plantar exion to limit the amount of force the gastrocnemii contributed to the net plantar exion moment. The plantar exion moment and the EMG data were sampled at 1000 Hz, and dual-pass ltered using a second order low-pass Butterworth lter with a cut-off frequency of 4 Hz. Notice how the rise in EMG preceded the increase in the moment by approximately 60 ms (Fig. 2). The efcacy of the method described in this paper was assessed by using Table 1 to choose lter parameters that would shift the EMG signal by 60 ms. The EMG data were ltered using these parameters and the resulting temporal shift was estimated as the time difference between the rst peak for the dual-pass and forward-ltered EMG signals.

It should also be noted that a1 k=f c , where k is a constant that depends only on the lter order N. Table 1 is based on Eqs. (6) and (7) and is used to approximate the time delay. Table 1 can be used to compute the delay associated with a given order and cut-off frequency, or can be used to select a lter order or cut-off frequency to achieve a desired delay. As an example of the latter process, suppose a 0.015 s delay is desired using a sixth order Butterworth low-pass lter. What cut-off frequency will give the desired delay? Table 1 shows

Table 1 Approximate time delays for various low-pass Butterworth digital lters Order 2 3 4 5 6 Delay 0.225/fc 0.318/fc 0.416/fc 0.515/fc 0.615/fc Order 7 8 9 10 11 Delay 0.715/fc 0.816/fc 0.917/fc 1.017/fc 1.118/fc Order 12 14 16 18 20 Delay 1.219/fc 1.421/fc 1.624/fc 1.826/fc 2.029/fc

3. Results Table 1 predicts that a second order Butterworth lter with a cut-off frequency of 4 Hz applied in the forward direction only will delay the signal by 0.056 s (i.e., 0.225/ f c 0:225=4). The forward-only and dual-pass ltered EMG signals are presented in Fig. 3. The time difference between peaks was approximately 0.060 s, which is very close to the 0.056 s delay predicted from Table 1.

Note that cut-off frequency, fc, should be entered as Hertz. The measurement unit for the time delay is seconds. For example, a low-pass, forward-ltered signal with f c 4 Hz and order N 4 will introduce a time delay of 0.416/(4 Hz) 0.104 s.

1.4 1.2 1 Voltage (V) 0.8 0.6 0.4 0.2 0 -0.2 0 0.5 1 1.5 2 Time (s) EMG Onset Increase in PF Moment 2.5 3 3.5 4
PF Moment Soleus EMG

70 60 50 40 30 20 10 0 -10 Newton-meters

Fig. 2. Thin line is the low-pass, zero-phase lag Butterworth ltered (fc 4Hz, N 4) soleus EMG data. Onset was determined visually and indicated by the arrow. The plantar exion moment data were ltered using the same lter parameters. The time difference between the increase in EMG and moment data is approximately 60 ms.

ARTICLE IN PRESS
K. Manal, W. Rose / Journal of Biomechanics 40 (2007) 678681 681

60 ms 1.4 1.2 Voltage (V) 1 0.8 0.6 0.4 0.2 0 0 0.1 0.2 0.3 0.4 0.5 0.6 Time (s) 0.7 0.8 0.9 1
Forward Only Dual-pass

Fig. 3. Thin line is the low-pass, zero-phase lag Butterworth ltered (f c 4, N 4) soleus EMG data. The thick line is the forward-only ltered soleus EMG data. The parameters for the forward-only Butterworth lter (f c 4, N 2) were determined from Table 1. The time difference between the peak EMGs for the ltered EMG signals is 60 ms. Only the rst second of the EMG data presented in Fig. 2 is displayed. This was done to increase the temporal resolution of the gure.

4. Discussion The purpose of this paper was to present a method for determining the delay of a Butterworth lter. Table 1 can be used in one of two ways: (1) to compute the delay introduced by a lter whose order and cut-off frequency are specied, or (2) to adjust the order and/or cut-off frequency in order to achieve a desired delay. The method is more efcient than dual-pass ltering and temporally shifting the EMG data to account for EMD, and it is well-suited for real-time applications. For example, we have developed a real-time EMG-driven virtual arm that has been used to investigate neuromuscular control of arm movements (Manal et al., 2002, Manal and Buchanan, 2005). It was the need for efcient data processing that precipitated the formulation of the method outlined in this paper. The absence of the sampling frequency from Table 1 is notable. However, the effect of sampling frequency is negligible if the cut-off frequency of the discrete lowpass lter is at least ten times lower than the sampling frequency. Another feature of the method is that it is possible to delay a signal by the same amount using different combinations of lter parameters. For example, a fourth order Butterworth lter with a 6 Hz cut-off will delay the signal by approximately 69 ms, the same amount as a sixth order lter with a 8.9 Hz cut-off. Note that the choice of parameters can affect the magnitude of the ltered signal. This may have important implications when identifying onset of muscle activity from the EMG, which depends on signal amplitude relative to a baseline value (Hodges and Bui, 1996). In addition, caution should be used if the required lter order exceeds N 12. Such high order discrete time lters

exhibit considerable ringing and are susceptible to round off error. Many factors can inuence the choice of lter. Some lter designs, e.g. Bessel, have better transient response than the Butterworth, but have a less sharp cutoff in the frequency domain. Other lters, e.g. Chebyshev and elliptic, have a sharper cutoff than Butterworth but poorer transient response. For this reason, many researchers use Butterworth lters as a compromise solution. The formulation presented in this paper is specic to Butterworth lters, targeting investigators who are experienced with and wish to continue to use this type of lter. A limitation of the method is that it approximates the time delay with a constant value that is independent of frequency. While the delay for a pure sinusoid can be determined accurately using the methods described in this paper, in practice, experimental data that require ltering are composed of sinusoids of varying amplitudes and frequencies. For this reason we chose a simple, objective, and repeatable method, viz. the time delay at zero frequency, which yields good approximations. The analytical formulation of the time delay introduced by a low-pass Butterworth lter was presented in this paper. The approximate time delay for any cut-off frequency and for order up to 20 is determined easily by using Table 1. In this respect, the values in the table may be thought of as a generalized solution.

Acknowledgment Supported by NIH Grants RR16458 and R-01 AR48212. References


Heine, R., Manal, K., Buchanan, T.S., 2003. Using Hill-type muscle models and EMG data in a forward dynamic analysis of joint moment: evaluation of critical parameters. Journal of Mechanics in Medicine and Biology 3 (2), 169186. Hodges, P.W., Bui, B.H., 1996. A comparison of computer-based methods for the determination of onset of muscle contraction using electromyography. Electroencephalography and Clinical Neurophysiology 101 (6), 511519. Lloyd, D.G., Besier, T.F., 2003. An EMG-driven musculoskeletal model to estimate muscle forces and knee joint moments in vivo. Journal of Biomechanics 36 (6), 765776. Manal, K., Buchanan, T.S., 2005. Use of an EMG-driven biomechanical model to study virtual injuries. Medicine and Science in Sports and Exercise 37 (11), 19171923. Manal, K., Buchanan, T.S., Shen, X., Lloyd, D.G., Gonzalez, R.V., 2002. Design of a real-time EMG driven virtual arm. Computers in Biology and Medicine 32, 2536. Oppenheim, A.V., Schafer, R.W., 1975. Digital Signal Processing. Prentice-Hall International, London. Winter, D.A., 1990. Biomechanics and Motor Control of Human Movement, second ed. Wiley, New York.

You might also like