Documentation
Tools for embedded systems
|
Real-time digital systems often require the calculation of a root-mean, such as a root-mean-square (RMS) level or average magnitude of a complex signal. While averaging can be efficiently implemented by most microprocessors, obtaining an efficient and rapidly converging algorithm is surely a time-consuming task due to the adjustments and optimizations that need to be performed. On the other hand, calculating the square root can be challenging, especially with low-cost hardware. If the processor does not have a built-in fast square root function, it must be implemented in software. While this can provide accurate results, it may not be as efficient.
qRMS provides a super-efficient method to compute the Recursive Root Mean Square (RMS). The implementation uses 3-stage filtering and Newton's method to obtain the square root. The filter parameters are perfectly tuned and optimized to converge in around 16 cycles, operating at a sampling rate of 1mS. This means that you must configure your embedded system to meet those specifications, either by configuring a timer interrupt or by delegating responsibility to a real-time task.
rms_compute.c
rms_compute.h