You are on page 1of 12

C H A P T E R 11

Signal Processing
Timothy R. Derrick

A signal is a time- or space-varying quantity that


conveys information. It may take the form of
a sound wave, voltage, current, magnetic field, dis-
• outline wavelet analysis,
• explain the sampling theorem,
• discuss how to ensure cyclic continuity, and
placement, or a host of other physical quantities.
These are examples of continuous signals (meaning • review various data-smoothing techniques.
that the signal is present at all instances of time or
space). For convenience and to enable manipulation CHARACTERISTICS OF A SIGNAL
by computer software, we often convert continuous
signals into a series of discrete values by sampling the A sinusoidal time-varying signal has four character-
phenomena at specific time intervals (figure 11.1). istics: frequency (f), amplitude (a), offset (a0), and
In this chapter, we phase angle (). These characteristics are depicted
in the schematics in figure 11.2. The frequency rep-
• define how to characterize a signal, resents how rapidly the signal oscillates and usually
• examine the Fourier analysis of signals, is measured in cycles per second (s) or hertz (Hz).

1.5

1.0

0.5
Acceleration (gⲐs)

⫺0.5

⫺1.0

⫺1.5
0 0.2 0.4 0.6 0.8 1.0
Time (s)

º Figure 11.1 The digitized discrete representation of the acceleration of the head while running. The signal was sampled
at 100 hertz (100 samples per second).

227
228 Research Methods in Biomechanics ___________________________________________________

Frequency: f

Amplitude: a

Offset: a0

0
c

Phase angle (shift): θ

º Figure 11.2 The four essential components of a time-varying signal.

One hertz (Hz) is equal to 1 cycle per second. For the signal is the amount of time the signal may be
example, the second hand of a clock completes one delayed or time shifted (figure 11.2d).
cycle every 60 seconds. Its frequency is one cycle per Any time-varying signal, h(t), is made up of these
60 seconds, or 1/60 Hz. The frequency of a signal is four characteristics. The following equation incor-
easy to determine in a single sine wave (figure 11.2a), porates each of the four variables:
but more difficult to visualize in noncyclic signals h(t) = a0 + a sin(2ft + ) (11.1)
with multiple frequencies. The amplitude of a signal
quantifies the magnitude of the oscillations (figure but 2f =  (because f is in cycles/s or Hz,  is in
11.2b). The offset (or direct current [DC] offset or radians per second and there are 2 radians in a
DC bias) represents the average value of the signal cycle), so another way to write this is
(figure 11.2c). The phase angle (or phase shift) in h(t) = a0 + a sin(t + ) (11.2)

2.0
2 ⫹ 20 Hz
1.5
1.0
Magnitude

0.5
0
⫺0.5
⫺1.0
⫺1.5
⫺2.0
0 0.5 1.0 1.5 2.0 2.5
Time (s)

º Figure 11.3 A 2 Hz and a 20 Hz sine wave summed over a 2.5 s period. The offset (a0 ) and angle () are zero for
both waves, and the amplitude is 1.
___________________________________________________________________ Signal Processing 229

The time (t) is a discrete time value that depends The Fourier coefficients can be calculated from
on how frequently the signal is to be sampled. If the the equally spaced time-varying points with the use
sampling frequency is 100 Hz (100 samples/s), then of a discrete Fourier transformation (DFT) algorithm
the sampling interval is the inverse (1/100th or 0.01). (appendix H). Given the Fourier coefficients, the
This means that there will be a sample or datum reg- original signal can be reconstructed using an inverse
istered every 0.01 s. So, t is one of the discrete values DFT algorithm. The DFT is a calculation-intensive
in the set (0, 0.01, 0.02, 0.03, . . . , T). The variable T algorithm. Faster and more commonly used are the
represents the duration of the digitized signal. For fast Fourier transformations (FFTs). An FFT requires
example, by adding the equations for a 2 Hz sine that the number of original data points be a power
wave to a 20 Hz sine wave, the following waveform of 2 ( . . . 16, 32, 64, 128, 256, 512, 1,024, . . . ). If
is created (as illustrated in figure 11.3): this is not the case, the usual method of obtaining a
“power of 2” number of samples is to pad the data
h(t) = sin(22t) + sin(220t) (11.3)
with zeros (add zeros until the number of points is
a power of two). This creates two problems:
FOURIER TRANSFORM
• Padding reduces the power of the signal. Par-
Any time-varying signal can be represented by succes- seval’s theorem implies that the power in the time
sively adding the individual frequencies present in domain must equal the power in the frequency
the signal (Winter 1990). The an and n values may domain (Proakis and Manolakis 1988). When you
be different for each frequency (fn) and may be zero pad with zeros, you reduce the power (a straight line
for any given frequency. at zero has no power). You can restore the original
power by multiplying the power at each frequency by
h(t) = a0 +  an sin (2fnt + n) (11.4)
(N + L)/N, where N is the number of nonzero values
By using the cosine and sine functions, this series can and L is the number of padded zeros.
be rewritten without the phase variable as • Padding can introduce discontinuities between
h(t) = a0 + [bn sin(2fnt) + cncos(2fnt)] (11.5) the data and the padded zero values if the signal does
not end at zero. This discontinuity shows up in the
This series is referred to as the Fourier series. The resulting spectrum as increased power in the higher
bn and cn coefficients are called the Fourier coeffi- frequencies. To ensure that your data start and end at
cients. They can be calculated using the following zero, you can apply a windowing function or subtract
formulae: the trend line before performing the transformation.
1T Windowing functions begin at zero, rise to 1 and then
a0 = Ú h( t) dt (11.6) return to zero again. By multiplying your signal by
T 0
a windowing function, you reduce the endpoints to
Ú h(t ) sin ( 2pfn t )dt
2 T
bn = (11.7) zero in a gradual manner. Windowing should not be
T0 performed on data unless there are multiple cycles.
Subtracting a trend line that connects the first point
Ú h( t ) cos (2 pfn t) dt
2 T
cn = (11.8) to the last point can be used as an alternative.
T 0
Here is another way of looking at it: If you want to Most software packages give the result of an FFT in
know how much of a certain frequency (fn) is pres- terms of a real portion and an imaginary portion. For
ent in a signal h(t), you can multiply your signal by a real discrete signal, the real portion corresponds
the sine wave [sin(2fnt)], take the mean value, and to the cosine coefficient and the imaginary portion
multiply it by 2. If you repeat this process for a cosine corresponds to the sine coefficient of the Fourier
wave and then add the squares of the sine and cosine series equation. An FFT results in as many coeffi-
values together, you will get an indication of how cients as there are data points (N), but half of these
much of the signal is composed of the frequency fn. coefficients are a reflection of the other half. There-
This is called the power at frequency fn. fore, the N/2 points represent frequencies from zero

a 0 = mean [ h(t )] (11.9)

[
bn = 2 ¥ mean h (t ) ¥ cos( 2pfn t) ] (11.10)

cn = 2 ¥ mean [ h( t) ¥ sin ( 2 pf t)]


n (11.11)
power ( fn ) = bn2 + c 2n (11.12)
230 Research Methods in Biomechanics ___________________________________________________

to one-half of the sampling frequency ( fs /2). Each


frequency bin has a width of fs /N Hz. By increasing
TIME-DEPENDENT FOURIER
the number of data points (by padding with zeros TRANSFORM
or collecting for a longer period of time), you can
The DFT has the advantage that frequencies can be
decrease the bin width. This does not increase the
separated no matter when they occur in the signal.
resolution of the FFT; rather, it is analogous to inter- Even frequencies that occur at the same time can be
polating more points from a curve. separated and quantified. A major disadvantage is
Researchers often adjust the bin width so that each that we do not know when those frequencies are pres-
bin is 1 Hz wide. This is referred to as normalizing the ent. We could overcome this difficulty by separating
spectrum. Adjusting the bin width changes the mag- the signal into sections and applying the DFT to each
nitude because the sum of the power frequency bins section. We would then have a better idea of when a
must equal the power in the time domain. Normal- particular frequency occurred in the signal. This pro-
izing the spectrum allows data of different durations cess is called a time-dependent Fourier transform.
or sampling rates to be compared. The magnitude Because we are already able to separate frequencies,
of a normalized spectrum is in units of (original we will use that technique to build an intuitive feeling
units)2/Hz. for how this transform works. If we take a signal that
A plot of the power at each frequency is referred contains frequencies from 0 to 100 Hz, the first step is
to as the power spectral density (PSD) plot or simply to separate the frequencies into two portions, 50 Hz
the power spectrum. A PSD curve contains the same and below and 50 Hz and above. Next, we take these
information as its time-domain counterpart, but it is two sections and separate them into two portions each.
rearranged to emphasize the frequencies that contain We now have sections of 0 to 50, 50 to 100, 0 to 25, 25 to
the greatest power rather than the point in time in 50, 50 to 75, and 75 to 100 Hz. This procedure—called
the cycle at which the most power occurs. Figure 11.4 decomposition—continues to a predefined level. At this
shows a leg acceleration curve along with its PSD. point, we have several time-series representations of the

4
Impact
line
2
Acceleration (g)

⫺2
Heel
strike
⫺4
0 0.2 0.4 0.6 0.8 1.0
a Time (s)

0.20
Impact
0.15 line
Active
PSD (g2/Hz)

strike
0.10

0.05

0
0 10 20 30 40 50
b Frequency (Hz)

º Figure 11.4 Leg acceleration during running in the (a) time and (b) frequency domains. The time domain graph shows
two ground impacts, whereas the frequency domain graph is for a single stance phase.
___________________________________________________________________ Signal Processing 231

From the Scientific Literature


Shorten, M.R., and D.S. Winslow. 1992. Spectral analysis of impact shock during running.
International Journal of Sport Biomechanics 8:288-304.

The purpose of this study was to determine the effects of increasing impact shock
levels on the spectral characteristics of impact shock and impact shock wave attenua-
tion in the body during treadmill running. Three frequency ranges were identified in leg
acceleration curves collected during the stance phase of running. The lowest frequen-
cies (4 to 8 Hz) were identified as the active region as a result of muscular activity. The
midrange frequencies (12 to 20 Hz) resulted from the impact between the foot and
ground. There was also a high-frequency component (60 to 90 Hz) resulting from the
resonance of the accelerometer attachment. Because these frequencies all occurred at
the same time, it was impossible to separately analyze them in the time domain. Head
accelerations were also calculated so that impact attenuation could be calculated from
the transfer functions (TFs). TFs were calculated from the power spectral densities at
the head (PSDhead) and the leg (PSDleg) using the following formula:
TF = 10 log10 (PSDhead / PSDleg) (11.13)
This formula resulted in positive values when there was a gain in the signal from the
leg to the head and negative values when there was an attenuation of the signal from
the leg to the head. The results indicated that the leg impact frequency increased as
running speed increased. There was also an increase in the impact attenuation so that
head impact frequencies remained relatively constant.

original signal, each containing different frequencies. Heisenberg’s uncertainty principle (both the time and
We can plot these representations on a three-dimen- frequency cannot be known at a point on the time-fre-
sional (3-D) graph with time on one axis, frequency quency plane). This is essentially a resolution problem
on a second axis, and magnitude on the third (figure that wavelet transformation techniques overcome with
11.5). There are problems with this process that involve the use of variable resolution.

100
º Figure 11.5 A 3-D contour
map of the frequency-by-time
values of a leg acceleration
80 curve during running. The
time domain curve is super-
imposed on the contour.
Frequency (Hz)

There are two peaks in this


60
curve. The high-frequency
peak (approximately 20 Hz)
occurs between 20 and 60
40 ms. The lower-frequency peak
(approximately 8 Hz) occurs
between 0 and 180 ms.
20

0
0 50 100 150 200 250 300
Time (ms)
232 Research Methods in Biomechanics ___________________________________________________

From the Scientific Literature


Wakeling, J.M., V. Von Tscharner, and B.M. Nigg. 2001. Muscle activity in the leg is tuned in
response to ground reaction forces. Journal of Applied Physiology 91:1307-17.

The purpose of this study was to investigate the response of muscle activity in the leg
to different impact forces. A human pendulum apparatus was used to control leg geom-
etry and initial conditions as the pendulum impacted a force platform. The loading rate
was varied by changing the viscoelastic properties of the shoe midsole. Myoelectrical
signals were recorded from the tibialis anterior, medial gastrocnemius, vastus media-
lis, and biceps femoris muscles. These signals were resolved by wavelet analysis into
their magnitudes in time and frequency space. Traditional Fourier transformations are
inadequate to describe a nonstationary signal like the one that would be anticipated
during the impact. Differences occurred in the magnitude, time, and frequency content
of the myoelectric signals during the period from 50 ms before impact until 50 ms after
impact. These differences justified the use of the wavelet technique to accomplish the
decomposition. The authors speculated that the change in myoelectric patterns that
occurred with different loading rates resulted from differences in muscle fiber-type
recruitment. Furthermore, they concluded that the levels of muscle activity adjusted in
response to the loading rate of the impact forces.

(Marks 1993). Figure 11.6 illustrates the use of the


SAMPLING THEOREM resampling formula to reconstruct a running vertical
The process signal must be sampled at a frequency GRF curve. The signal was originally sampled at 1000
greater than twice as high as the highest frequency Hz, and the impact peak was measured at 1345 N.
present in the signal itself. This minimum sampling rate Every 20th point was then extracted to simulate data
is called the Nyquist sampling frequency (fN). In human sampled at 50 Hz. The peak value occurred between
locomotion, the highest voluntary frequency is less than samples, with the nearest data point at 1316 N. This
10 Hz, so a 20 Hz sampling rate should be satisfactory; also changed the time of occurrence of the impact
however, in reality, biomechanists usually sample at 5 peak. After applying the reconstruction formula to
to 10 times the highest frequency in the signal. This the 50 Hz data, the peak was restored to 1344 N with
ensures that the signal is accurately portrayed in the the same time of occurrence as the originally sampled
time domain without missing peak values. data. With modern computers, there is little reason to
The sampling theorem holds that if the signal is undersample a signal unless the hardware is somehow
sampled at greater than twice the highest frequency, limited, as is often the case when collecting kinematic
then the signal is completely specified by the data. In data from video cameras with a sampling rate limited
fact, the original signal (h) is given explicitly by the to 60 or 120 Hz.
following formula (also see appendix I):
ENSURING CIRCULAR
È sin [ 2pfc ( t - nD) ] ˘
h (t ) = D Â hn Í ˙ (11.14) CONTINUITY
ÍÎ p (t - nD) ˙˚
For the resampling formula to work correctly, the
where  is the sample period (1/sampling frequency), data must have circular continuity. To understand
fc is 1/(2hn is the nth sampled datum, and t is the what circular continuity is, draw a curve from end to
time. By using this formula (Shannon’s reconstruc- end on a piece of paper and then form a tube with
tion formula; Hamill, Caldwell and Derrick 1997), it the curve on the outside by rolling the paper across
is possible to collect data at slightly greater than twice the curve. Circular continuity exists if there is no
the highest frequency and then apply the reconstruc- “discontinuity” where the start of the curve meets the
tion formula to “resample” the data at a higher rate end of the curve. This means that the first point on
___________________________________________________________________ Signal Processing 233

2500

2000
Force (N) 1345 N
1500

1000

500

0
0 50 100 150 200 250
Time (ms)

2500

2000
1316 N
Force (N)

1500

1000

500

0
0 50 100 150 200 250
Time (ms)

2500

2000
1344 N
Force (N)

1500

1000

500

0
0 50 100 150 200 250
Time (ms)

º Figure 11.6 A running vertical GRF curve sampled at 1,000 Hz (top), sampled at 50 Hz (middle), and sampled at 50 Hz,
then reconstructed at 1,000 Hz (bottom). The magnitude of the impact peak is identified in each graph. Reconstructing the
signal results in a peak value very close to the original.

the curve must be equal to the last point. Neverthe- oscillations become smaller (damped) the farther
less, the principle of circular continuity goes further: you get from the endpoints, and they become much
The slope of the curve at the start must equal the more evident if derivatives are calculated.
slope of the curve at the end. The slope of the slopes Use the following steps (Derrick 1998) to approxi-
(the second derivative) must also be continuous. If mate circular continuity (see figure 11.7):
you do not have circular continuity and you apply
Shannon’s reconstruction algorithm, you may be • Split the data into two halves.
violating the assumption that only frequencies of • Copy the first half of the data in reverse order
less than half of the sampling frequency are present and invert them. Attach this segment to the front
in the data. Discontinuities are by definition high- of the original data.
frequency changes in the data. If this occurs, you will • Copy the second half of the data in reverse order
see in the reconstructed data oscillations that have and invert them. Attach this segment to the back
high amplitudes at the endpoints of the curve. These of the original data.
234 Research Methods in Biomechanics ___________________________________________________

• Subtract the trend line from the first data point each data point. Thus, the first and last points will
to the last data point. be equal to zero.
If you fail to heed the sampling theorem, you not
Reversal of the first or second half of data is a proce- only lose the higher frequencies, but the frequencies
dure by which the first data point becomes the last above the 1/2fN (half the Nyquist frequency) actually
data point of the segment, the second data point fold back into the spectrum. In the time domain,
becomes the second to last, and so on. Inversion this is referred to as aliasing. An anti-aliasing low-
is a procedure that flips the magnitudes about a pass filter with a cutoff greater than 1/2fN applied
pivot point. The pivot point is the point closest in to a signal before it is analyzed ensures that there is
proximity to the original data. Figure 11.7 shows a no aliasing.
schematic diagram of the data after summing the
front and back segments and before subtracting the
trend line. SMOOTHING DATA
Errors associated with the measurement of a biologi-
Trend line cal signal may be the result of skin movement, incor-
rect digitization, electrical interference, artifacts
from moving wires, or other factors. These errors, or
Back “noise,” often have characteristics that are different
segment from the signal. Noise is any unwanted portion of a
Front waveform. It is typically nondeterministic, lower in
segment amplitude, and often in a frequency range different
from that of the signal. For instance, errors associ-
ated with the digitizing process are generally higher
Original data
in frequency than human movement. Noise that has
º Figure 11.7 Schematic diagram of the procedure used to a frequency different from those in the signal can
ensure that a signal has the property of circular continuity. be removed. If you were to plot the signal and the
signal plus noise, it would look like figure 11.8. The
goal of smoothing is to eliminate the noise, but leave
Step 2 ensures circular continuity at the start of the signal unaffected.
the original data set. Step 3 ensures circular conti- There are many techniques for smoothing data
nuity at the end of the original data set. Steps 2 and to remove the influence of noise. Outlined below
3 together ensure that the slopes at the start and are a number of the most popular. Each has its own
end of the new data set are continuous, but it is still strengths and weaknesses, and none is best for every
possible to have a gap between the magnitude of situation. Researchers must be aware of how each
the first point and the magnitude of the last point method affects both the signal and the noise com-
of the new data set. Step 4 removes this gap by cal- ponents of a waveform. Ideally, the signal would be
culating the difference between the trend line and unaffected by the smoothing process used to remove

2.5
2.0 Signal
1.5 Signal ⫹ noise
1.0
Magnitude

0.5
0
⫺0.5
⫺1.0
⫺1.5
⫺2.0
0 0.5 1.0 1.5 2.0 2.5
Time (s)

º Figure 11.8 A biological signal with and without noise.


___________________________________________________________________ Signal Processing 235

the noise, but most smoothing techniques affect the MOVING AVERAGE
signal component to some extent.
A three-point moving average is accomplished by
replacing each data point (n) by the average of
POLYNOMIAL SMOOTHING n – 1, n, and n + 1. A five-point moving average
Any n data points can be fitted with a polynomial of utilizes the data points n – 2, n – 1, n, n + 1, and
degree n – 1 of the following form: n + 2 and results in more smoothing than a three-
x(t) = a0 + a1t + a2t 2 + a3t 3 + point moving average does. Note that there will be
(11.15) undefined values at the start and end of the series.
. . . + an – 1t n - 1
This method is extremely easy to implement but is
This polynomial will go through each of the n data incapable of distinguishing signals from noise. It
points, so no smoothing has been accomplished. will attenuate valid signal components and may not
Smoothing occurs by eliminating the higher-order affect invalid noise components. A better choice is
terms. This restricts the polynomial to lower-fre- the digital filter.
quency changes and thus it will not be able to go
through all of the data points. Most human move- DIGITAL FILTERING
ments can be described by polynomials of the ninth
order or less. Polynomials produce a single set of A digital filter is a type of weighted moving average.
coefficients that represent the entire data set, result- The points that are averaged are weighted by coef-
ing in large savings in computer storage space. The ficients in such a manner that a cutoff frequency
polynomial also has the advantages of allowing you can be determined. In the case of a low-pass filter,
to interpolate points at different time intervals and of frequencies below the cutoff are attenuated whereas
making the calculation of derivatives relatively easy. frequencies above the cutoff are unaffected.
Unfortunately, they can distort a signal’s true shape; The type of digital filter is determined by the fre-
see the article by Pezzack, Norman, and Winter quencies that are passed through without attenua-
(1977)—reviewed in chapter 1—for an example of tion. The following digital filters are all implemented
this technique. In practice, avoid using polynomial in the same manner, but the coefficients are adjusted
fitting unless the signal is a known polynomial. For for a particular cutoff frequency. Signals that are
example, fitting a second-order (parabolic) polyno- band passed or notch filtered are run through the
mial to the vertical motion of the center of gravity filter with both low-pass and high-pass cutoff frequen-
of an airborne body is appropriate. The path of the cies (figure 11.9).
center of gravity during walking follows no known
Type of Filter
polynomial function, however.
Filters can be constructed to attenuate different parts
of the frequency spectrum. One or sometimes two
SPLINES cutoff frequencies are necessary to define which part
A spline function consists of a number of low-order of the frequency spectrum is attenuated and which
polynomials that are pieced together in such a way part is left “as is,” or passed unattenuated.
that they form a smooth line. Cubic (third-order)
and quintic (fifth-order) splines are the most popular • Low-pass: The cutoff is selected so that low fre-
for biomechanics applications (Wood 1980). Splines quencies are unchanged, but higher frequencies are
are particularly useful if there are missing data in attenuated. This is the most common filter type. It is
the data stream that need interpolation. Many tech- often used to remove high frequencies from digitized
niques, such as digital filtering (discussed below), kinematic data and as a digital anti-aliasing filter.
require equally spaced data. Splines do not have this • High-pass: The cutoff is selected so that high fre-
requirement. quencies are unchanged, but lower frequencies are
attenuated. It is used as a component in band-pass
FOURIER SMOOTHING and band-reject filters or to remove low-frequency
Fourier smoothing consists of transforming the movement artifacts from low-voltage signals in wires
data into the frequency domain, eliminating the that are attached to the body (e.g., electromyo-
unwanted frequency coefficients, and then per- graphic [EMG] signals).
forming an inverse transformation to reconstruct • Band-pass: The frequencies between two cutoff
the original data without the noise. Hatze (1981) frequencies are passed unattenuated. Frequencies
outlined how to apply this method for smoothing below the lower cutoff and frequencies above the
displacement data. higher cutoff are attenuated. Such a filter is often
236 Research Methods in Biomechanics ___________________________________________________

1 Recursive and Nonrecursive Filters


Recursive filters use both raw data and data that were
already filtered to calculate each new data point.
LP They sometimes are called infinite impulse response
(IIR) filters. Nonrecursive filters use only raw data
points and are called finite impulse response (FIR)
0 filters. It is theoretically possible that a recursive filter
1 will show oscillations in some data sets, but they will
have sharper roll-offs. Data that are smoothed using
HP a recursive filter will have a phase lag, which can
be removed by putting the data through the filter
twice—once in the forward direction and once in
reverse. The filter is considered a zero lag filter if the
0
net phase shift is zero. Digital filters distort the data at
1 the beginning and end of a signal. To minimize these
distortions, extra data should be collected before and
BP after the portion that will be analyzed.

Optimizing the Cutoff


The selection of a cutoff frequency is very important
0 when filtering data. This is a somewhat subjective
1 determination based on your knowledge of the
signal and the noise. A number of algorithms try to
find a more objective criterion for determining the
Notch cutoff frequency (Jackson 1979). These optimizing
algorithms typically are based on an analysis of the
residuals, which are what is left over when you subtract
0
the filtered data from the raw data. As long as only
noise is being filtered, some of these values should be
º Figure 11.9 Frequency responses of different types of
digital filters. The digital filter is implemented in the time greater than zero and some less than zero. The sum
domain, but it can be visualized in the frequency domain. The of all of the residuals should equal zero (or at least be
frequency response function is multiplied by the signal in the close). When the filter starts affecting the signal, the
frequency domain and then transformed back into the time sum of the residuals will no longer equal zero. Some
domain. LP = low pass; HP = high pass; BP = band pass. optimization routines use this fact to determine which
frequency best distinguishes the signal from the noise
(figure 11.10). These algorithms are not completely
used in EMG when there is movement artifact in the
objective, however, because you still must determine
low-frequency range and noise in the high-frequency
how close to zero the sum of the residuals is before
range.
selecting the optimal cutoff frequency.
• Band-reject: The frequencies between the two
cutoff frequencies are attenuated. The frequencies Steps for Designing a Digital Filter
below the lower cutoff and above the higher cutoff The following steps create a Butterworth low-pass,
are passed unattenuated. This filter has little use in recursive digital filter. Modifications for a critically
biomechanics. damped and a high-pass filter are also discussed.
• Notch: A narrow band or single frequency is Butterworth filters are said to be optimally flat
attenuated. It is used to remove power-line noise (60 in the pass band, making them highly desirable
or 50 Hz) or other specific frequencies from a signal. for biomechanical variables. This means that the
This filter generally is not recommended for EMG amplitudes of the frequencies that are to be passed
signals, because they have significant power at 50 to are relatively unaffected by the filter. Some filters,
such as the Chebyshev, have better roll-offs than the
60 Hz (for additional information, see chapter 8).
Butterworth filter, but they alter the amplitudes of
Filter Roll-Off the frequencies in the pass band.
Roll-off is the rate of attenuation above the cutoff fre-
1. Convert the cutoff frequency (fc) from Hz to
quency. The higher the order (the more coefficients)
rad/s.
or the greater the number of times the signal is passed
through the filter, the sharper the roll-off. A = 2 fc (11.16)
___________________________________________________________________ Signal Processing 237

Sum of residuals

Threshold
Threshold

Optimal Cutoff frequency

º Figure 11.10 Selection of an optimal cutoff frequency using residual analysis.

2. Adjust the cutoff frequency to reduce “warping” The filter is recursive because previously filtered
that resulted from the bilinear transformation. data—Yn – 1 and Yn – 2—are used to calculate the
filtered data point, Yn.
È wA ˘
W A = tan Í ˙ Yn = C1 Xn – 2 + C2 Xn – 1 + C3 Xn +
ÍÎ 2 ¥ sample rate ˙˚ (11.17)
(11.20)
C4Yn – 1 + C5Yn – 2
3. Adjust the cutoff frequency for the number of This filter is underdamped (damping ratio
passes (P). A pass occurs each time the data are = 0.707) and will therefore “overshoot” and
passed through the filter. For every pass through “undershoot” the true signal whenever there
the data, a second pass must be made in the is a rapid change in the data stream. For more
reverse direction to correct for the phase shift. information, consult the article by Robertson
Increasing the number of passes increases the and Dowling (2003). A critically damped filter
sharpness of the roll-off. can be designed (damping ratio = 1) by changing
WA 2 to 2 in each equation in step 4. The warping
WN = Ê1
4
2 Á ˆ˜
ËP¯
-1 (11.18)
function must also be altered as follows:
WA
WN = (11.21)
4. Calculate the coefficients.
2 
Ê 1 ˆ
ÁË ˜
2P ¯
-1
W 2N
C1 = In practice, there is little difference between the
(1+ 2W N + W 2N ) underdamped and critically damped filter. The
2W 2N distinction can be seen in response to a step input
C2 = = 2C 1 (a function that transitions from 0 to 1 in a single
(1 + 2W N + W 2N ) step). The Butterworth filter will produce an arti-
W 2N ficial minimum before the step and an artificial
C3 = = C1 (11.19)
maximum after the step (Robertson and Dowling
(1 + 2W N + W 2N ) 2003).
2(1- W N )
2
It is possible to calculate the coefficients so that
C4 = the filter becomes a high-pass filter instead of a
(1 + 2W + W ) N
2
N low-pass filter (Murphy and Robertson 1994). The
(  2W - W - 1) N
2
N
first step is to adjust the cutoff frequency by the fol-
C5 = = 1– lowing:
(1 + 2W + W ) N
2
N
fs
(C + C + C + C )
1 2 3 4
fc =
2
- fc -old (11.22)

5. Apply the coefficients to the data to implement where fc is the new cutoff frequency, fc-old is the old
the weighted moving average. Yn values are cutoff frequency, and fs is the sampling frequency.
filtered data and Xn values are unfiltered data. The coefficients (C1 through C5) are then calculated
238 Research Methods in Biomechanics ___________________________________________________

in the same way that they were for the low-pass filter errors in digitizing create high-frequency noise
and then the following adjustments are made: that, after double differentiating, dominates true
data history. Removing high-frequency noise prior
c1 = C1, c2 = –C2, c3 = C3, c4 = –C4, and c5 = C5 (11.23)
to differentiation prevents this problem. The bio-
where c1 through c5 are the coefficients for the high- mechanist, however, should be aware of how these
pass filter. The data can now be passed through the smoothing processes affect data so that an appro-
filter, forwards and backwards, just as in the low-pass priate method can be applied without distorting
filter case outlined previously. the true signal.

SUMMARY SUGGESTED READINGS


This chapter outlined the basic principles and rules Burrus, C.S., R.A. Gopinath, and H. Guo. 1998. Introduc-
for characterizing and processing signals acquired tion to Wavelets and Wavelet Transforms, A Primer. Upper
from any data-collection system. Special emphasis Saddle River, NJ: Prentice Hall.
was given to the frequency or Fourier analysis of Press, W.H., B.P. Flannery, S.A. Teukolsky, and W.T. Vet-
signals and data smoothing. Data-smoothing tech- terling. 1989. Numerical Recipes in Pascal, 422-97. New
niques are of particular interest to biomechanists York: Cambridge University Press.
because of the frequent need to perform double Transnational College of LEX. 1995. Who Is Fourier? A
time differentiation of movement patterns to obtain Mathematical Adventure. Trans. Alan Gleason. Belmont,
accelerations. As illustrated in chapter 1, small MA: Language Research Foundation.

You might also like