Moved whistler_spectra into a function file as it used in two separate scripts.