Changeset 9f8e8a9


Ignore:
Timestamp:
Mar 6, 2013, 10:56:53 PM (7 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
129b269
Parents:
d5e846c
Message:

demos/demo_spectrogram.py: add samplerate option to spectrogram

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/demos/demo_spectrogram.py

    rd5e846c r9f8e8a9  
    66from pylab import imshow, show, cm, axis, ylabel, xlabel, xticks, yticks
    77
    8 def get_spectrogram(filename):
    9   samplerate = 44100
     8def get_spectrogram(filename, samplerate = 0):
    109  win_s = 512                                        # fft window size
    1110  hop_s = win_s / 2                                  # hop size
     
    1312
    1413  a = source(filename, samplerate, hop_s)            # source file
     14  if samplerate == 0: samplerate = a.samplerate
    1515  pv = pvoc(win_s, hop_s)                            # phase vocoder
    1616  specgram = zeros([0, fft_s], dtype='float32')      # numpy array to store spectrogram
Note: See TracChangeset for help on using the changeset viewer.