ref: 70798871d8eab68a6acbc402413bccbfd3fce9d5
parent: c52b4833bd21d4e80f6a4924031a71ab3d94f9ad
author: Paul Brossier <piem@piem.org>
date: Thu Oct 17 10:46:47 EDT 2013
demos/demo_waveform_plot.py: add downsample parameter
--- a/python/demos/demo_waveform_plot.py
+++ b/python/demos/demo_waveform_plot.py
@@ -4,7 +4,7 @@
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 @@
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