Hey everyone,

Please forgive me if this has been asked before.  I searched for related questions, but couldn't find any.

I was just taking a look at the latest ArduIMU code and I find it curious that the comment in the ADC code says that the oversampling and averaging being used is increasing the resolution of the ADC.

It appears to me that the sum of all of the samples is just being divided by the number of samples.  I don't see how that can provide any increased resolution, that just provides an averaged value that should help reduce noise.  I don't have any experience in this area, but everything that I've read states that to increase the resolution by n bits you would add 4 ^ n samples then right shift the sum n bits.  So the sum of four 10 bit samples divided by 2 will give you an 11 bit result.  Or 16 samples divided by 4 to get a 12 bit value...

Here's a link to Atmel's App Note on the subject:

http://www.atmel.com/dyn/resources/prod_documents/doc8003.pdf

I have have just started implementing this in my code.  For my application I'm looking for a more precise roll angle and I'm hoping oversampling/averaging to obtain a 12 bit resolution will help out.

Please let me know if I'm just confused.  :)

Thanks,
Dave

Views: 314

### Replies to This Discussion

You are spot on, I'm not really following it in the code either. The ISR and the way it is laid out makes it hard to follow but i'm seeing what you are seeing. Doug? Jose?
See this post for real-world details as applied to MEMS sensors.
Dave,
The method you describe is necessary to increase resolution correctly if you work with binary integer data. The ArduIMU code sidesteps that problem by converting accumulated data to a floating point number before averaging (see the cast in the code).

Both methods increase bit width (necessary for extra precision) and both are correct, just select the method that works best for your data. ArduIMU does subsequent floating point operations on data so converting to floats early is logical.
Is there any documentation or explination for this? I can grasp it, I just like to have solid foundations for my many "black majic assumptions" when it comes to the wonderful math and theory of digital signal processing!

Thanks!

In order to exploit increased resolution (SNR) in a binary system you need more data bits to represent the signal. The answer I gave above was directed more toward the mechanics of increasing bit width, since that seemed to be the drive of the original question.
probably the method of bit shifting while an integer is quite a bit faster then doing FP Add / divide...
Yeah, yet another reason to do everything in integer format as much as possible.
Yes, but it also limits you to integer bit width increases. So you need to oversample 4x for 1 bit, 16x for 2 bits etc. If you can't get enough samples in a time period you can't make the gains.

Using fp you can average any number of samples together and each gives a fractional increase in effective resolution. So if you oversample 14x you can get an effective increase of 1.7 bits resolution (value plucked from ether for illustration, there is a formula but not in my head at this time of night :P) vs 1 bit for the integer shifting technique.
awesome, I like it!

en..I think the floating operation is more suitable for the DSP

here is another post of the oversample technique from microchip with the document and sourecode

http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&...

1

2

3

4

5

6

7

8

9

10

## Groups

93 members

1796 members

26 members

72 members

• ### Spanish arducopter Users

107 members

Season Two of the Trust Time Trial (T3) Contest has now begun. The fifth round, 3D model building requiring contestants to survey and reconstruct a building or natural scene from aerial images.

A list of all T3 contests is here.