??? 11/29/06 11:51 Read: times |
#128657 - Some hints Responding to: ???'s previous message |
TempL = 255 * (long)Sample.Filtered; TempL = TempL >> 8; Every time you divide without rounding, you introduce a 1 LSB error. Proper rounding will reduce the error to 0.5 LSB. 2. is there is any trik to avoid 32 bit calculations in ISR due to iir filter. Some of them can be avoided, but this involved doing really ugly things in C (like declaring a datatype that is a union of long, ints and chars) or using assembly. Maybe the compiler itself is smart enough to recognize that the result of 255 * (long) [some 16-bit int] has 24 bits and not 32. However, what you can avoid is using signed longs for most of the calculations, by using an offset. |
Topic | Author | Date |
filter for DC offset removal | 01/01/70 00:00 | |
I think its already done | 01/01/70 00:00 | |
Some hints | 01/01/70 00:00 | |
confusion.. | 01/01/70 00:00 | |
Do you need real time? | 01/01/70 00:00 | |
how this removes DC offset?![]() | 01/01/70 00:00 |