For anyone who is concerned about the sampling rate of the methods in emonLib, the sampling rates, measured with a standard emonTx V3.4 (and the emonPi is the same processor) are:
calcIrms( ) - approx 5588 current samples per second.
calcVI( ) - approx 2535 pairs of voltage & current samples per second.
For calcVI( ), which can start and finish sampling close to a zero crossing point, those values are informative only.
For calcIrms( ), the numbers are important because they enable you to get as close as practical to sampling a whole number of complete cycles, which is important for accuracy & repeatability.
Useful values to use as a parameter into calcIrms( ) are:
1 cycle of mains:
112 for a 50 Hz system, or 93 for a 60 Hz system.
The smallest ‘universal’ number:
559 (100 ms, or 5 cycles of 50 Hz or 6 cycles of 60 Hz).
The recommended monitoring period:
1676 (300 ms).
The closest integer to an integral multiple of 558.8 is also a good choice.
[Note: If your mains frequency is not exactly 50 Hz or 60 Hz, then these numbers are only a ‘best guess’.]