Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Database float64 values
#1
Hello,

As I read you are making a new version of the software, well I have some recommendation.
The ADE7878 outputs 24 bit numbers, that you convert into float64. This is OK for doing intermediate calculations to not loose the precision, but it makes no sense to output values as float64 or even store them into a database, since the float64 has 52 bit mantissa, while you get raw data with only 24 bit precision. So my recommendation is to use 32 bit float numbers as a result and database format. 

A 32 bit float has 23 bit mantissa, 1 bit sign and 8 bit exponent, total 32 bits. ADE7878 outputs 24 bit integer values, MSB is sign and 23 bits is number. When multiplying, dividing with float64 you won't loose almost anything, then simply convert the result into 32 bit float. You won't have any loose in precision.

This can save huge amount of storage space (double) without practically loosing any precision.
Reply
#2
Hello,

The SmartPi will also be able to read other sensors in the future. In order to have the highest possible accuracy in the future, we have prepared the data and the database for float64.
Reply
#3
(14.10.2019, 11:17)clemens Wrote: Hello,

The SmartPi will also be able to read other sensors in the future. In order to have the highest possible accuracy in the future, we have prepared the data and the database for float64.

OK, but the point is that you won't have any better accuracy, just data overhead, reducing the space on SD card and more CPU load when transferring large chunks of data.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)