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
4from aubio import pvoc, source4from aubio import pvoc, source
5from numpy import zeros, hstack5from numpy import zeros, hstack
6 6
7def get_waveform_plot(filename, samplerate = 0, block_size = 4096, ax = None):7def get_waveform_plot(filename, samplerate = 0, block_size = 4096, ax = None, downsample = 2**4):
8 import matplotlib.pyplot as plt8 import matplotlib.pyplot as plt
9 if not ax:9 if not ax:
10 fig = plt.figure()10 fig = plt.figure()
@@ -12,7 +12,7 @@ def get_waveform_plot(filename, samplerate = 0, block_size = 4096, ax = None): · 1 unmodified line
12 hop_s = block_size12 hop_s = block_size
13 13
14 allsamples_max = zeros(0,)14 allsamples_max = zeros(0,)
15 downsample = 2**4 # to plot n samples / hop_s15 downsample = downsample # to plot n samples / hop_s
16 16
17 a = source(filename, samplerate, hop_s) # source file17 a = source(filename, samplerate, hop_s) # source file
18 if samplerate == 0: samplerate = a.samplerate18 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