Spectrogram calculation for NumPy