Greg Kawchuk

08-10-1998, 04:08 AM

Here are the responses to the posting listed below. Thanks to all of those

who responded.

My question involves determining the resampling frequency of a

> signal that has been oversampled initially. My end goal is to determine

> the first derivative of this signal with respect to time.

>

> I am collecting data and sending control signals from an A/D board at

> 1000Hz, the rate at which the control signals need to be generated.

> Unfortunately, the tasks on the board can not be split with respect to

> event speed and as a result, data is collected at 1000Hz as well.

>

> The problem is that for the data I am collecting, a 1000Hz collection

rate

> results in an oversampled signal. Giannis Giakas has suggested

> that the resampling frequency can be found by determining the frequency

> content of the signal, then finding the frequency where x% of the signal

> is contained.

When this is done, the first derivative of the resultant signal will

> dramatically change when resampled at frequencies corresponding to 99.0,

> 99.5 and 99.9% of signal content (i.e. 3Hz, 16 Hz and 30 Hz

respectively).

>

> Can anyone:

> 1] recommend another method of determining the resampling

> frequency?

>

> and/or

>

> 2] provide a rationale for why the resampling frequency

should

> be taken at a specific percentage of signal content?

>

> Thank you in advance. I will publish a summary of any responses.

>

> __________________________________________________ __________________

> Greg Kawchuk D.C., M.Sc.

> Clinician, University Health Services

> Ph.D. Candidate, McCaig Centre for Joint Injury and Arthritis Research

you must filter your acquired signal before you resample it. Since the

signal

includes already noise when you resample it this noise is included in your

new

signal.

Vassilios Vardaxis

************************************************** ***************

Woltring dealt with this issue in great detail and was able to take highly

accurate first and second derivatives after over-sampling displacement

data.

Look up his paper on instataneous helical axis of joints and determining

3d

location and orientation data (first auther Veldpaus).

In brief, the method is to resample the data over intervals by calculating

an

average value for the interval of oversampled data. This also has a

smoothing

effect. As long as your final sampling frequency pays appropriate homage

to

the Nyquist frequency of your raw data, you will do just fine. Woltring

consulted with me on my thesis data before his passing. Woltring was able

to

reproduce bang-bang accelerations and excellent representation of the

accelerations from gravity from displacement data.

Hope you are doing well.

Jay Triano

************************************************** ***********

Part of the measurement is noise,This noise is usually white, which means

it is spread evenly in the frequency domain.

In the spectrum you should see a distinct increase if

you look at the graph from the highest frequency down .

And another kind of interference is a distinct frequency

Like the power line ( 50 HZ in Europe), it should appear as a big spike.

You should set your resampling frequency below all of them if possible, or

if not do it until the effect of white noise decay and uses notch filter

on

the power line interference.

One of the things you must do is filter the signal before resampling

(usually done by an FIR filter).

Another idea is just to build a derivative filter.

The idea is that at high frequency derivative of :

sin(w*t) is W*sin(w*t) and therefor noise causes error

(becouse he is the dominant party at higher frequencies.

The frequency response of a perfect derivative is a straight line going up

(j*w), you must create a filter that doesn't have a high response in high

frequencies,

This the best solution, instead of resampling .

sin(w*t) is W*sin(w*t) and therefor noise causes error

(becouse he is the dominant party at higher frequencies.

The frequency response of a perfect derivative is a straight line going up

(j*w), you must create a filter that doesn't have a high response in high

frequencies,

This the best solution, instead of resampling .

Ran Ravhon

Biomed. Dept.

Technion Israel

************************************************** ***************8

Here's my two cents worth of thoughts and suggestions related to your

resampling question.

> My end goal is to determine the first derivative of this signal

with respect to time.

> Giannis Giakas has suggested that the resampling frequency can be

found by determining the frequency content of the signal, then finding

the frequency where x% of the signal is contained.

Since I am not familiar with the method of Giakas I will not comment on

that in particular, but rather give my own "independent" view of

how you could proceed.

In taking the derivative of the signal, you amplify the higher frequency

components of the signal relatively to the lower ones (since what you're

actually doing is to multiply each signal component's amplitude by its

own frequency). This means, of course, that the "frequency content" of

the derivative signal will be different from that of the original signal;

its power spectrum will be displaced towards the higher frequencies.

If I am right in interpreting your posting, you state that 99.0% of the

original signal's power is present at frequencies below 3Hz,

99.5% is below 16Hz and so on. This, then, will NOT be the case for the

derivative of the signal; you might have to go to considerably higher

frequencies to cover the same percentage of the signal power.

Another matter which you do not mention is Nyquist's sampling theorem,

which implies that the data acquisition frequency (sampling rate) must be

AT LEAST twice that of the highest frequency component you want to

capture.

Signal components with requencies above half the sampling rate will be

"aliased";

they will appear in the digitized signal as having LOWER frequencies.

Unless I have misinterpreted your posting, here's what I suggest:

1. Be sure to low-pass filter the original signal so that the A/D board

"sees" a signal with no/little power at frequencies above 500Hz

(=1000Hz/2)

to avoid aliasing.

2. Take the derivative of the digitized signal, and determine the

frequency

where x% of this signal is contained.

3. Optional step: Numerically low-pass filter the derivative signal to

remove/

attenuate the frequency components above the "x% frequency"; this reduces

the

aliasing effect induced by the next step, which is to...

4. re-sample the derivative signal at TWICE the "x% requency" (ref.

Nyquist)

Depending on how keen you are to make analog filters, you could also

differentiate

the signal _prior_to_sampling_ by means of an analog element like

h(s) = Ks/(1+Ts)

to avoid potential problems associated with numerical differentiation. In

this

case

a good ("high"-order) anti-aliasing filter is crucial. The factor 1/(1+Ts)

serves

to band-limit the differentiation process, and in fact just adds one to

the

order

of the anti-aliasing filtering. However, this factor should be implemented

in

the same

If you settle for a re-sampling frequency which is an integer fraction of

the

original sampling frequency, the re-sampling

is straightforward; you pick every N'th sample and discard the rest.

Otherwise you should first decimate the signal in order to artificially

increase

the sampling rate to the lowest possible integer multiple of your

re-sampling

frequency. This issue is described in several textbooks on digital signal

processing.

Ignoring the need for decimation will distort your signal and essentially

add a

bunch

of noise.

Numerical differentiation is a hard subject - in which I am not an expert

myself.

Nevertheless, you're welcome to write back if you want to discuss it.

I hope some of my thoughts can prove useful, and I am looking forward to

reading

your summary.

Humbly, with the best wishes,

Oyvind Stavdahl (M.Sc., Ph.D. student)

Department of Engineering Cybernetics

NTNU, The Norwegian University of

Science and Technology Direct line: +47 73 59 43 77

O. Bragstads plass 8 Switchboard: +47 73 59 43i 76

N-7034 TRONDHEIM Fax: +47 73 59 43 99

NORWAY Email: Oyvind.Stavdahl@itk.ntnu.no

http://www.itk.ntnu.no/ansatte/Stavdahl_Oyvind

************************************************** *********8

to sample a signal you have to follow the shannon theorem, which says

that your sampling frequency (Fs) must be greater than

twice the frequency of the measured signal (Fm) (Fs>2*Fm).

If you do a Fourieranalysis (FFT) of your signal, you will see in the

frequency-domain the highest frequency components of your signal.

With this information it is possible to select the resampling

frequency.

It would be helpful to compare the signal with different

sampling frequencies (oversampling in different steps

Fs=3*Fm,Fs=4*Fm,Fs=5*Fm,...). So you will find the optimized sampling

frequency.

I hope this information helps.

Good luck

Christian Peham

************************************************** *****************8

Oversampling is not a problem; undersampling produces aliasing, which is

impossible to adjust for post-facto.

There is no need to resample in order to compute the first derivative.

What

you need to do is to filter your data first in order to smooth out the

noise

and then apply a simple three-point differencing scheme (e.g., V1 =

(X2-X0)/

(2delT) ). Check out David Winters' 1990 book on Biomechanics for an

intro

to this topic. A fairly simple approach is to use a digital filter such

as

a Butterworth filter with a cutoff frequency above the frequencies of

interest in your raw data. You can't pick the frequency corresponding to

a

percentage of the energy in the signal because that will depend on how

noisy

your signal is. Winters describes an approach based on estimating where

the

amount of signal you throw away is equal to the amount of noise you

accept.

Woltring has a more theoretically rigorous approach to this question using

the technique of generalized cross-validation (other names to look up

include Trujillo and Busby). You can also look up a paper I wrote about

four years ago (http://www.mech.ubc.

ca/~ahodgson/Research/Publications/publicat.htm).

Good luck!

Tony Hodgson

UBC Mechanical Engineering

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

To unsubscribe send UNSUBSCRIBE BIOMCH-L to LISTSERV@nic.surfnet.nl

For information and archives: http://www.bme.ccf.org/isb/biomch-l

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

who responded.

My question involves determining the resampling frequency of a

> signal that has been oversampled initially. My end goal is to determine

> the first derivative of this signal with respect to time.

>

> I am collecting data and sending control signals from an A/D board at

> 1000Hz, the rate at which the control signals need to be generated.

> Unfortunately, the tasks on the board can not be split with respect to

> event speed and as a result, data is collected at 1000Hz as well.

>

> The problem is that for the data I am collecting, a 1000Hz collection

rate

> results in an oversampled signal. Giannis Giakas has suggested

> that the resampling frequency can be found by determining the frequency

> content of the signal, then finding the frequency where x% of the signal

> is contained.

When this is done, the first derivative of the resultant signal will

> dramatically change when resampled at frequencies corresponding to 99.0,

> 99.5 and 99.9% of signal content (i.e. 3Hz, 16 Hz and 30 Hz

respectively).

>

> Can anyone:

> 1] recommend another method of determining the resampling

> frequency?

>

> and/or

>

> 2] provide a rationale for why the resampling frequency

should

> be taken at a specific percentage of signal content?

>

> Thank you in advance. I will publish a summary of any responses.

>

> __________________________________________________ __________________

> Greg Kawchuk D.C., M.Sc.

> Clinician, University Health Services

> Ph.D. Candidate, McCaig Centre for Joint Injury and Arthritis Research

you must filter your acquired signal before you resample it. Since the

signal

includes already noise when you resample it this noise is included in your

new

signal.

Vassilios Vardaxis

************************************************** ***************

Woltring dealt with this issue in great detail and was able to take highly

accurate first and second derivatives after over-sampling displacement

data.

Look up his paper on instataneous helical axis of joints and determining

3d

location and orientation data (first auther Veldpaus).

In brief, the method is to resample the data over intervals by calculating

an

average value for the interval of oversampled data. This also has a

smoothing

effect. As long as your final sampling frequency pays appropriate homage

to

the Nyquist frequency of your raw data, you will do just fine. Woltring

consulted with me on my thesis data before his passing. Woltring was able

to

reproduce bang-bang accelerations and excellent representation of the

accelerations from gravity from displacement data.

Hope you are doing well.

Jay Triano

************************************************** ***********

Part of the measurement is noise,This noise is usually white, which means

it is spread evenly in the frequency domain.

In the spectrum you should see a distinct increase if

you look at the graph from the highest frequency down .

And another kind of interference is a distinct frequency

Like the power line ( 50 HZ in Europe), it should appear as a big spike.

You should set your resampling frequency below all of them if possible, or

if not do it until the effect of white noise decay and uses notch filter

on

the power line interference.

One of the things you must do is filter the signal before resampling

(usually done by an FIR filter).

Another idea is just to build a derivative filter.

The idea is that at high frequency derivative of :

sin(w*t) is W*sin(w*t) and therefor noise causes error

(becouse he is the dominant party at higher frequencies.

The frequency response of a perfect derivative is a straight line going up

(j*w), you must create a filter that doesn't have a high response in high

frequencies,

This the best solution, instead of resampling .

sin(w*t) is W*sin(w*t) and therefor noise causes error

(becouse he is the dominant party at higher frequencies.

The frequency response of a perfect derivative is a straight line going up

(j*w), you must create a filter that doesn't have a high response in high

frequencies,

This the best solution, instead of resampling .

Ran Ravhon

Biomed. Dept.

Technion Israel

************************************************** ***************8

Here's my two cents worth of thoughts and suggestions related to your

resampling question.

> My end goal is to determine the first derivative of this signal

with respect to time.

> Giannis Giakas has suggested that the resampling frequency can be

found by determining the frequency content of the signal, then finding

the frequency where x% of the signal is contained.

Since I am not familiar with the method of Giakas I will not comment on

that in particular, but rather give my own "independent" view of

how you could proceed.

In taking the derivative of the signal, you amplify the higher frequency

components of the signal relatively to the lower ones (since what you're

actually doing is to multiply each signal component's amplitude by its

own frequency). This means, of course, that the "frequency content" of

the derivative signal will be different from that of the original signal;

its power spectrum will be displaced towards the higher frequencies.

If I am right in interpreting your posting, you state that 99.0% of the

original signal's power is present at frequencies below 3Hz,

99.5% is below 16Hz and so on. This, then, will NOT be the case for the

derivative of the signal; you might have to go to considerably higher

frequencies to cover the same percentage of the signal power.

Another matter which you do not mention is Nyquist's sampling theorem,

which implies that the data acquisition frequency (sampling rate) must be

AT LEAST twice that of the highest frequency component you want to

capture.

Signal components with requencies above half the sampling rate will be

"aliased";

they will appear in the digitized signal as having LOWER frequencies.

Unless I have misinterpreted your posting, here's what I suggest:

1. Be sure to low-pass filter the original signal so that the A/D board

"sees" a signal with no/little power at frequencies above 500Hz

(=1000Hz/2)

to avoid aliasing.

2. Take the derivative of the digitized signal, and determine the

frequency

where x% of this signal is contained.

3. Optional step: Numerically low-pass filter the derivative signal to

remove/

attenuate the frequency components above the "x% frequency"; this reduces

the

aliasing effect induced by the next step, which is to...

4. re-sample the derivative signal at TWICE the "x% requency" (ref.

Nyquist)

Depending on how keen you are to make analog filters, you could also

differentiate

the signal _prior_to_sampling_ by means of an analog element like

h(s) = Ks/(1+Ts)

to avoid potential problems associated with numerical differentiation. In

this

case

a good ("high"-order) anti-aliasing filter is crucial. The factor 1/(1+Ts)

serves

to band-limit the differentiation process, and in fact just adds one to

the

order

of the anti-aliasing filtering. However, this factor should be implemented

in

the same

If you settle for a re-sampling frequency which is an integer fraction of

the

original sampling frequency, the re-sampling

is straightforward; you pick every N'th sample and discard the rest.

Otherwise you should first decimate the signal in order to artificially

increase

the sampling rate to the lowest possible integer multiple of your

re-sampling

frequency. This issue is described in several textbooks on digital signal

processing.

Ignoring the need for decimation will distort your signal and essentially

add a

bunch

of noise.

Numerical differentiation is a hard subject - in which I am not an expert

myself.

Nevertheless, you're welcome to write back if you want to discuss it.

I hope some of my thoughts can prove useful, and I am looking forward to

reading

your summary.

Humbly, with the best wishes,

Oyvind Stavdahl (M.Sc., Ph.D. student)

Department of Engineering Cybernetics

NTNU, The Norwegian University of

Science and Technology Direct line: +47 73 59 43 77

O. Bragstads plass 8 Switchboard: +47 73 59 43i 76

N-7034 TRONDHEIM Fax: +47 73 59 43 99

NORWAY Email: Oyvind.Stavdahl@itk.ntnu.no

http://www.itk.ntnu.no/ansatte/Stavdahl_Oyvind

************************************************** *********8

to sample a signal you have to follow the shannon theorem, which says

that your sampling frequency (Fs) must be greater than

twice the frequency of the measured signal (Fm) (Fs>2*Fm).

If you do a Fourieranalysis (FFT) of your signal, you will see in the

frequency-domain the highest frequency components of your signal.

With this information it is possible to select the resampling

frequency.

It would be helpful to compare the signal with different

sampling frequencies (oversampling in different steps

Fs=3*Fm,Fs=4*Fm,Fs=5*Fm,...). So you will find the optimized sampling

frequency.

I hope this information helps.

Good luck

Christian Peham

************************************************** *****************8

Oversampling is not a problem; undersampling produces aliasing, which is

impossible to adjust for post-facto.

There is no need to resample in order to compute the first derivative.

What

you need to do is to filter your data first in order to smooth out the

noise

and then apply a simple three-point differencing scheme (e.g., V1 =

(X2-X0)/

(2delT) ). Check out David Winters' 1990 book on Biomechanics for an

intro

to this topic. A fairly simple approach is to use a digital filter such

as

a Butterworth filter with a cutoff frequency above the frequencies of

interest in your raw data. You can't pick the frequency corresponding to

a

percentage of the energy in the signal because that will depend on how

noisy

your signal is. Winters describes an approach based on estimating where

the

amount of signal you throw away is equal to the amount of noise you

accept.

Woltring has a more theoretically rigorous approach to this question using

the technique of generalized cross-validation (other names to look up

include Trujillo and Busby). You can also look up a paper I wrote about

four years ago (http://www.mech.ubc.

ca/~ahodgson/Research/Publications/publicat.htm).

Good luck!

Tony Hodgson

UBC Mechanical Engineering

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

To unsubscribe send UNSUBSCRIBE BIOMCH-L to LISTSERV@nic.surfnet.nl

For information and archives: http://www.bme.ccf.org/isb/biomch-l

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