History

demos/demo_waveform_plot.py: add downsample parameter

Paul Brossier committed 13 years ago

Commit 70798871 parent c52b4831 file · +2 −2Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/demos/demo_waveform_plot.py+2−2
@@ -4,7 +4,7 @@ import sys · 3 unmodified lines
44 from aubio import pvoc, source
55 from numpy import zeros, hstack
66
7−def get_waveform_plot(filename, samplerate = 0, block_size = 4096, ax = None):
7+def get_waveform_plot(filename, samplerate = 0, block_size = 4096, ax = None, downsample = 2**4):
88 import matplotlib.pyplot as plt
99 if not ax:
1010 fig = plt.figure()
@@ -12,7 +12,7 @@ def get_waveform_plot(filename, samplerate = 0, block_size = 4096, ax = None): · 1 unmodified line
1212 hop_s = block_size
1313
1414 allsamples_max = zeros(0,)
15− downsample = 2**4 # to plot n samples / hop_s
15+ downsample = downsample # to plot n samples / hop_s
1616
1717 a = source(filename, samplerate, hop_s) # source file
1818 if samplerate == 0: samplerate = a.samplerate

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t