11.10.2019, 15:42
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.
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.