- Timestamp:
- Apr 2, 2005, 3:29:23 PM (20 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- cf7c76a
- Parents:
- e50b695
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/aubio/gnuplot.py
re50b695 ra0fd4e4 109 109 data.append(myvec.get(curpos,i)) 110 110 curpos+=1 111 # FIXME again for the last frame112 curpos = 0113 while (curpos < readsize):114 data.append(myvec.get(curpos,i))115 curpos+=1116 111 time = arange(len(data))*framestep 117 112 return time,data 118 113 119 def plot_audio(filenames, fileout=None, start=0, end=None, noaxis=None , task=audio_to_array):114 def plot_audio(filenames, fileout=None, start=0, end=None, noaxis=None): 120 115 g = Gnuplot.Gnuplot(debug=1, persist=1) 121 116 d = [] … … 125 120 g.gnuplot('set multiplot;') 126 121 while (len(filenames)): 127 b,a = task(filenames.pop(0)) 128 d.append(Gnuplot.Data(b,a)) 122 d.append(plot_audio_make(filenames.pop(0))) 129 123 if not noaxis and todraw==1: 130 124 g.xlabel('Time (s)') … … 141 135 g.hardcopy(fileout, enhanced=1, color=0) 142 136 137 def make_audio_plot(time,data,maxpoints=10000): 138 """ create gnuplot plot from an audio file """ 139 import numarray 140 length = len(time) 141 downsample = length/maxpoints 142 if downsample == 0: downsample = 1 143 x = numarray.array(time).resize(length)[0:-1:downsample] 144 y = numarray.array(data).resize(length)[0:-1:downsample] 145 return Gnuplot.Data(x,y,with='lines')
Note: See TracChangeset
for help on using the changeset viewer.