Guest User

Untitled

a guest
Mar 23rd, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. import matplotlib.pyplot as plt
  2. import scikits.audiolab as audiola **#Este modulo solo esta para python 2.6**
  3. sound = audiolab.sndfile('Violin_for_spectrogram.ogg', 'read')
  4. y = sound.read_frames(sound.get_nframes())
  5. Pxx, freqs, bins, im = plt.specgram(y, NFFT=512, Fs=44100)
  6. plt.xlim(0, len(y) / 44100.0)
  7. plt.ylim(0, 22050.0)
  8. plt.colorbar(im).set_label(u'Intensidad (dB)')
  9. plt.xlabel(u'Tiempo (s)')
  10. plt.ylabel(u'Frecuencia (Hz)')
Add Comment
Please, Sign In to add comment