Pages: [1]   Go Down
Author Topic: Question about digital filters and sample skipping  (Read 555 times)
0 Members and 1 Guest are viewing this topic.
Thessaloniki, Greece
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello !

I am somehow new to digital sensors and I have a question concerning the digital output from a BMA180 acceleration sensor. I admit that I couldn't figure out the answer from the datasheet.

This sensor has built-in digital filters which you may select, however the available sample is updated (by default) every 417 μS (i.e. 2400 Hz), in low-noise mode. The user can enable an interrupt on this frequency and get results every 417 μS.

There is another nice feature, called sample-skipping, where you can tie the sample frequency (i.e. the above interrupt) to the double of the selected filter frequency, e.g. if you select a filter of 40 Hz, the interrupt fires at 80 Hz (i.e. every 12.5 ms).

My question is what sample skipping means, and how the digital filter comes into play... does it mean that the sensor, internally, makes ADC conversions at 2400 Hz, applying the filter, and gives you output at 80 Hz, or does it make conversions only at 80 Hz ? And if the latter holds, what is happening to the 40 Hz filter ?

Sorry if this sounds noob, but I am a bit confused and I would really appreciate any help ! smiley
Logged

0
Offline Offline
Shannon Member
****
Karma: 199
Posts: 11639
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My question is what sample skipping means, and how the digital filter comes into play... does it mean that the sensor, internally, makes ADC conversions at 2400 Hz, applying the filter, and gives you output at 80 Hz, or does it make conversions only at 80 Hz ? And if the latter holds, what is happening to the 40 Hz filter ?

Yes, that's it - the breakpoint of the digital filter is not the sampling rate.  The sampling is at 2400Hz, the digital filter then produces filtered samples at 2400Hz.   Since there should be no useful information above 40Hz you only need to (resample) this signal at 80Hz to get all the useful data.  This does rely on the filter being a brickwall and not letting any appreciable signal through at/above 40Hz (such signals would create aliases below 40Hz).  However digital filters can have very large numbers of poles and be very close to an ideal brickwall filter.

If there were no digital filter and you read samples at 80Hz then all the multiples of 80Hz would alias all the other multiples of 80Hz (ie 10, -70, 90, -150, 170, -230, 250, 330 Hz would all alias each other, as would 20/-60/100/-140/180/-220/260/340 etc.  This would mean the different frequencies would all pollute each other.

(-70 Hz is like 70Hz but time-reversed, so its 70Hz at a different phase).

In order for no frequency aliasing to take place there should be no frequencies from the sensor at or above 1200Hz to start with (so that sampling at 2400Hz doesn't loose information - this will be done with some crude analog filtering I suspect), then the digital filter removes all signals at or above 40Hz, so we can then safely resample at 80Hz.  Technically the term for resampling at a lower rate is called "decimation" (the opposite is interpolation), and a combined low-pass filter and decimation step is usually called a "decimation filter" - a special case of resampling.

Logged

[ I won't respond to messages, use the forum please ]

Thessaloniki, Greece
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks a very lot for such valuable information, I really appreciate smiley
Logged

Pages: [1]   Go Up
Jump to: