noise detector - functional version