Reworked frequencyanalysis into analysis.py