Showing the changes to python (1 of 1 file). Show all
Unified · Split
| @@ -4,7 +4,7 @@ import sys · 3 unmodified lines | |||
| 4 | from aubio import pvoc, source | 4 | from aubio import pvoc, source |
| 5 | from numpy import zeros, hstack | 5 | from numpy import zeros, hstack |
| 6 | 6 | ||
| 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): |
| 8 | import matplotlib.pyplot as plt | 8 | 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_size | 12 | 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_s | 15 | downsample = downsample # to plot n samples / hop_s |
| 16 | 16 | ||
| 17 | a = source(filename, samplerate, hop_s) # source file | 17 | a = source(filename, samplerate, hop_s) # source file |
| 18 | if samplerate == 0: samplerate = a.samplerate | 18 | if samplerate == 0: samplerate = a.samplerate |