Skip to content

Instantly share code, notes, and snippets.

@cryptospectrum
Created March 30, 2013 06:06
Show Gist options
  • Save cryptospectrum/5275585 to your computer and use it in GitHub Desktop.
Save cryptospectrum/5275585 to your computer and use it in GitHub Desktop.
Spectrogram Example, Python
from pylab import *
import wave
sig = wave.open('ycn9999 _out.wav','r')
xsig = sig.readframes(-1)
xsig = fromstring(xsig, 'Int16')
f = sig.getframerate()
spectrogram = specgram(xsig[0:300000], Fs = f, scale_by_freq=True,sides='default')
axis('tight')
title('Spectrogram of Sound Synthesis Variant 2, with Python');
show()
sig.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment