Extracted small wavelet calculations
Extracted average_output()