spectrogram now works for r>1