Rewrite spectrogram demo to use mostly python