old spectrogram function