Spectrogram calculation for NumPY