refactoring threshold
Noise power real fix