From: Paul Brossier Date: Thu, 17 Oct 2013 12:46:47 +0000 (+0200) Subject: demos/demo_waveform_plot.py: add downsample parameter X-Git-Tag: 0.4.0-beta1~110^2~1 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=70798871d8eab68a6acbc402413bccbfd3fce9d5;p=aubio.git demos/demo_waveform_plot.py: add downsample parameter --- diff --git a/python/demos/demo_waveform_plot.py b/python/demos/demo_waveform_plot.py index 0f1f02a1..91c6eda2 100755 --- a/python/demos/demo_waveform_plot.py +++ b/python/demos/demo_waveform_plot.py @@ -4,7 +4,7 @@ import sys from aubio import pvoc, source from numpy import zeros, hstack -def get_waveform_plot(filename, samplerate = 0, block_size = 4096, ax = None): +def get_waveform_plot(filename, samplerate = 0, block_size = 4096, ax = None, downsample = 2**4): import matplotlib.pyplot as plt if not ax: fig = plt.figure() @@ -12,7 +12,7 @@ def get_waveform_plot(filename, samplerate = 0, block_size = 4096, ax = None): hop_s = block_size allsamples_max = zeros(0,) - downsample = 2**4 # to plot n samples / hop_s + downsample = downsample # to plot n samples / hop_s a = source(filename, samplerate, hop_s) # source file if samplerate == 0: samplerate = a.samplerate