A critical operation in digital signal processing is the calculation of the power spectral lines for the examined signal. This operation requires that for each spectral line the square root of the sum of the squares of the line's sine and cosine components be computed. Normally, this operation requires a multiplication and a square root algorithm, the execution of which takes a significant amount of time. In many cases, this time comprises most of the total computation time.
A linear approximation algorithm for the square root of the sum of the squares has been developed, and has the following form:
if a>= 8b, SQRT(a^2 + b^2) = a
if b>= 8a, SQRT(a^2 + b^2) = b
Otherwise, SQRT(a^2 + b^2) = 0.789062(a+b)
In binary, 0.789062 = 0.1100101.
The software implementation of this algorithm is very simple and the obtained result has a maximum error of 12%, which for many application is acceptable; considering that the average error is only half as much.