PDA

View Full Version : filter response



Dr. Guy Simoneau
12-05-1997, 10:11 AM
Thank you to all who responded to my question about filtering.
The answers were most helpful.

************************************************** *******
My original posting was.

In the process of analyzing some wrist kinematic data that we collected
with the use of electrogoniometers, an interesting question was raised
by one of our graduate students.

Background: Our interest is to look at position, velocity and acceleration
of the wrist during various tasks. Since the electrogoniometers provide
position data, we differentiate the signal once for the velocity
and twice for the acceleration data. In order to eliminate noise
in the signal we use a fourth order, zero phase shift, Butterworth filter
with a cut-off frequency of 6 Hz. This filter is applied to the raw position
data.

His question was: should we apply the filter to the data again after each step
where the signal has been differentiated. His logic was that the process
of differentiating the signal would create a higher frequency component
in the signal. So, in essence we would filter the raw position data,
differentiate the signal to get velocity, filter the velocity data, then
differentiate the signal to get acceleration.

************************************************** ********
I believe that the following answers best summarize the responses.
All answers are at the end of this message for those of you with a greater
interest.

Summary of answers:
-------------------------------
you should review the recent work of Giakas and Baltzopoulos, Journal of
Biomechanics (1997), 30 (8), 851-856. Also, on a historical note, Vaughan
(1982) might have been one of the first to publish results based on
acceleration data that had been previously filtered twice.
--------------------------------
Filters such as splines, Butterworth digital filters, etc. act as
linear operators. So does a finite-difference differentiation.
This means that you can interchange the order of these operations
without affecting the result.

So, if you apply the same filter again, after differentiating,
you would get the same result as if you had applied the filter
twice to the raw position data, before differentiating.

This would give you effectively a higher-order filter (though no
longer a Butterworth filter!), with a slightly lower cut-off
frequency.
--------------------------------
My immediate reaction against this idea is that the three resulting signals
(position, velocity and acceleration) would NOT resemble the pos., vel. and acc.
of a single physical figure any more. Position is (per def:-) the integral of
the corresponding velocity, which by definition is the integral of the
corresponding
acceleration (we ignore the constants of integration for clarity). If filtering
is applied between each differentiation stage, this is no longer true for the
resulting signals.

**********************************************
All answers are included below

I am sure you will receive other messages to the same extent, but you
should review the recent work of Giakas and Baltzopoulos, Journal of
Biomechanics (1997), 30 (8), 851-856. Also, on a historical note, Vaughan
(1982) might have been one of the first to publish results based on
acceleration data that had been previously filtered twice. Good luck.

Peter Vint
e-mail: pfvint@homans.uncg.edu
-------------------------------------
In effect the process is quite simple. When you filter twice with a
filter with a transfer function H(jw), the resultant transfer function is
H^2 (jw). For a low-pass filter this means the same cut-off frequency, but
a steeper cut-off of the high frequencies.Differentiation is, like
filtering, a linear process. This means that the order in which things are
done is irrelevant. Filter-
differentiate- filter- differentiate will work out just the same as any
other sequence, e.g. D-D-F-F. Just try it!The only thing that may interfere
maybe round-off errors, which
may make one sequence preferable to the other. I hope this advice is of
some help,

At Hof
e-mail: a.l.hof@med.rug.nl
------------------------------------
I'm glad you raised this issue. I discovered myself that it was, indeed,
necessary to filter after each differentiation, otherwise the result is too
noisy. As I understand it what this does in effect is to sharpen the filter
frequency response, so that the cutoff is, in effect, lowered. I guess you
could calculate the precise effect in MATLAB, but I've never done it. What
I'd like to know is whether the commercical motion systems, such as Vicon
or MAC do this?

Dr. Chris Kirtley (Kwok Kei Chi) MD PhD
email rskirt@polyu.edu.hk
--------------------------------
we also calculate the acceleration by deriving the time
series. A derivation is the equivalent of a first-order high pass
filter. To calculate the acceleration, this first-order high pass is
used twice. As derivation amplifies the higher frequency parts, it is
necessary to limit the spectrum. This is done by smoothing the data
using a low pass filter e. g. with a third-degree smoothing spline.
This is a passband filter to extract the wanted signal from noise.
The influence of the filter shape to the wanted signal depends on the
cut-off frequency, the filter shape and the ripple of the low pass
filter.
If the transfer function (filter shape) is known, it is possible to
determine the influence of once or twice filtering to the wanted
signal.
We had this problem by determing the motion symmetry of horses,
therefore we developed a system matched filter. This was published
1996 (Peham C., Scheidl M., and Theresia Licka: "A method of signal
processing in motion analysis of the trotting horse".)in the J.
Biomechanics, Vol. 29, No. 8, pp. 1111-1114.

* Christian Peham *
* email: Christian.Peham@vu-wien.ac.at *
------------------------------------
My immediate reaction against this idea is that the three resulting signals
(position, velocity and acceleration) would NOT resemble the pos., vel. and acc.
of a single physical figure any more. Position is (per def:-) the integral of
the corresponding velocity, which by definition is the integral of the
corresponding
acceleration (we ignore the constants of integration for clarity). If filtering
is applied between each differentiation stage, this is no longer true for the
resulting signals.

The spectre of the acceleration and velocity SHOULD be richer in high
frequencies
than the corresponding position signal. Maybe the right thing to to would be to
filter the original pos. data "three times" (by applying the filter three
times in
"cascade" or by tripling the filter's order) _before_ the two
differentiations are
carried out.

If noise due to round-off errors during differentiation is a problem,
you could follow the procedure you suggested except that after both
differentiations
are carried out, the velocity should be filtered again once and the pos.
data twice
so that all signals are filtered an equal number of times. In this case
"pure integral"
relationships would not be strictly preserved, but in the presence of round-off
errors it wouldn't anyway.

Oyvind Stavdahl (Siv.ing., Dr.ing. student)
Email: Oyvind.Stavdahl@itk.ntnu.no
------------------------------
I have the "intuitive" impression that applying a filter to the
velocity (after the first differentiation) is equivalent to applying
a stronger filter to the position data. The same with filtering the
acceleration itself: it is equivalent to a stronger filter to the
velocity data.

To demonstrate this you can apply Fourier or Laplace transformation.
A(s)=sV(s)=ssX(s).
So if you apply filter H(s) to V(s), you get:
A'(s)=sH(s)V(s)=s(sH(s))X(s), and see that sH(s) is a much
stronger filter for X(s).

Ruben Lafuente-Jorge
E-Mail: rlafuent@ibv.upv.es
---------------------------
This was the issue in one of our papers recently published. We
examined different filtering+differentiation sequences and one of
them was the one you mentioned (Procedure 3 in the paper).

The problem with this sequence is that it presents big problems at
the endpoints. Moreover we found that the acceleration was quite
oversmoothed (like a flat pattern).

The important finding from that study was that the normal sequence
(Procedure 1 - filtering raw displacement data and then differentiate
for the velocity and acceleration), is not the best we can use.

Instead the data should be filtered using different cut-off
frequencies (Procedure 2) for each derivative domain. However they
have to be filtered in the 0th derivative. The cut-off for
acceleration should be (most of the cases) lower than the one used
for velocity, which in turn has to be lower than the one used for
displacement.
How much lower ? This is a question !!! Based on the findings and
experience I personaly use a cut-off decreased by 10% in each
derivative domain (so if CFd=10 Hz for displacement, then CFv=9Hz and
CFa=8).

Giannis

Giakas G and V Baltzopoulos (1997). Optimal digital filtering
requires a different cut-off frequency strategy for the determination
of the higher derivatives. Journal of Biomechanics 30(8), 851-855

Giannis Giakas PhD
Email: g.giakas@staffs.ac.uk
-------------------------------------
I don't think you should filter the velocity data again before differentiate
velocity data for acceleration if you are interested in all position,
velocity, and acceleration data, because the differentiations will not be the
true differentiations of the position data if you filter the velocity data
again before the second differentiation. You may find the following two
recent references helpful:

Giakas, G. and Baltzopoulos, V. A comparison of automatic filtering
techniques applied to biomechanical walking data. Journal of Biomechanics,
1997, 8: 847-850.

Giakas, G. and Baltzopoulos, V. Optimal digital filtering requires a
different cut-off frequency strategy for the determination of the higher
derivatives. Journal of Biomechanics, 1997, 8: 851-856.

Bing Yu, Ph.D.
--------------------------------
differentiating a signal strongly amplifies high frequency components of
the signal
(because that what's differentiating is all about). Look in textbooks of
signals analysis *) what happens in the frequency-domain and you'll
understand.
Clearly this procedure will worsen the signal to noise ratio.
There is nothing wrong in filtering the signal with a low pass filter,
to increase the signal -to noise ratio. The only thing you'll have to
know is that this procedure limits the bandwith of events you'll want to
interprete. It is for YOU to decide whether this might hide important
information, or just removes noise. (There is more to say, but this
requires a priori knowledge about the original signal).
So if you filter the signal each time with 6 Hz after differentiating,
no conclusions about components of velocity or acceleration above 6 Hz
can be drawn. This might not be a problem for a student class, but it is
clear that fast transients in position data contain high frequency
components in the accelaration. Again: this is the nature of the
problem.
Conclusion: filtering is OK as long as every statement about
accelerations etc. is done in the context of a specified bandwidth.
(Which should always be the case, from an electrical engineer's point of
view.)

*) I would recommend "designing digital filters" from Charles S.
Williams, [prentice-hall, 1986]
---------------------------
Theoretically, it is not right to filter again after each derivation. Becase
the high frequency components in the velocity and acceleration are natural
and from the actual movement, so that you can not simply throw them away. If
you do, then you will deal with three different movements represented by the
position, the velocity and the acceleration, respectively. We know that the
velocity should be 0 when the position shows an extreme value, and so on.
But by filtering the data repeatedly after each derivation, you would ruin
this relationships among the physical quantities.

So the rationale here would be: (a) choose the physical quantity (either
position, velocity or acceleration) you wish to filter, (b) filter this
particular quantity, and (c) do derivation or integration to obtain the
other quantities.

In this way, you are basically dealing with the same movement represented in
different forms by different mechanical quantities.

Young-Hoo Kwon, Ph.D.
Internet: y-hkwon@sports.re.kr
ykwon@wp.bsu.edu (English only)

--------------------------------------------------------------

I can't answer your question, but you could probably answer it yourself
by doing a numerical simulation (this would also probably make a nice
reference technical note for the biomechanics community).

Here is what you could try (if you felt so inclined):
* Come up with several unperturbered position signals which represent
typical movements (e.g., wrist movements in your case). Since you
know the real underlying position signal, you can easily determine
the actual corresponding velocity and acceleration signals (e.g.,
using analytic techniques or cubic interpolating splines).
* Contaminate the simulated position signals with appropriate noise
(you would have to determine what appropriate noise is). You would
probably have to generate 10 or more perturbed position signals for
each unperturbed position signal.
* Try your new multiple-filtering approach on the perturbed signals, and
see how well you reproduce the true velocity and acceleration data
relative to how well one can do with the traditional approach.

I don't know much about signal processing, so I will be curious to see
what other BIOMCH-L readers have to say in response to your question.
There is probably some good theoretical reason why your student's idea
would or would not be a good approach.

Benjamin J. Fregly, Ph.D.
E-mail: bj@sj.ptc.com
> ------------------------------
Filtering and differentiating are both linear operations (ie, it doesn't
matter which order you apply them in), so there's no benefit to refiltering
prior to the second differentiation (unless you want your velocity and
acceleration signals filtered differently). The net effect is of filtering
with a single filter of higher order and lower cutoff frequency (say ~ 4 Hz
- you'd have to check a Bode plot to be sure). Your student is right that
differentiating amplifies higher frequencies - you might want to check into
some form of cross-validation procedure for estimating accelerations.

Cheers,

Tony
----------------------------
Filters such as splines, Butterworth digital filters, etc. act as
linear operators. So does a finite-difference differentiation.
This means that you can interchange the order of these operations
without affecting the result.

So, if you apply the same filter again, after differentiating,
you would get the same result as if you had applied the filter
twice to the raw position data, before differentiating.

This would give you effectively a higher-order filter (though no
longer a Butterworth filter!), with a slightly lower cut-off
frequency.

In my opinion, this would only lead to confusion, and could also
be sub-optimal. Higher-order filters don't work well on signals
with a broad spectrum, and if you need a lower cut-off frequency
you can simply design the (first) filter that way, rather than
apply it twice.

So I would say, apply a filter only once, and design it so that
it gives you good results at the end of the analysis.

-- Ton van den Bogert



************************************************** ******************
Guy G. Simoneau, Ph.D., P.T., A.T.C.
Assistant Professor, Physical Therapy Department
Marquette University
Walter Schroeder Complex, Room 346
P.O. Box 1881
Milwaukee, WI 53201-1881

e-mail: simoneaug@vms.csd.mu.edu
Phone: 414-288-3380
Fax: 414-288-5987
************************************************** ******************