added average noise calculation