CalculateSpectrogram function

Calculates the spectrogram of a signal