05-19-2006 06:06 PM
05-20-2006 01:26 AM
05-20-2006 11:23 PM
Thanks Chilly...
But yours has the same problem mine did. Here is the example that causes problems.
bit length = 7
two input numbers to be averaged: a) 0x 3F and b) 0x 41
The correct average is: 0x 40
but your version gives average as Zero.
I got the same result with a similar approach calculating error-distance from mid-pt of range based on number of bits.
the problem is that this case strattles the mid-pt. Shifting to another pt. just moves the problem pt. I though of trying a
zero-crossing detection of the error signal to use a straight average for this case. I'm coding now for a try. If you, or
anyone else has any thought s on this please let me know.
Thanks.
05-21-2006 04:08 AM
The average of 0x3F and 0x41 corresponds to the average of 63 and -63 : zero ! The only way to get 0x40 as result is to average a series of 0x40 !? 🙂
05-23-2006 03:37 AM