Comparison of averaging algorithms for wireless sensor networks