tools.calculateDispersion: writes time and frequencies to file, tools.writeToFile: Allows for different filename