Refactor debug tone into toneAnalysis library