History

python/aubio/task/onset.py: use numarray, not numpy (debian #478438)

Paul Brossier committed 17 years ago

Commit fcacd881 parent a250b351 file · +6 −6Browse files

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

Unified · Split

python/aubio/task/onset.py+6−6
@@ -92,7 +92,7 @@ class taskonset(task): · 91 unmodified lines
92 import Gnuplot, Gnuplot.funcutils92 import Gnuplot, Gnuplot.funcutils
93 import aubio.txtfile93 import aubio.txtfile
94 import os.path94 import os.path
95 import numarray95 from numpy import arange, array, ones
96 from aubio.onsetcompare import onset_roc96 from aubio.onsetcompare import onset_roc
97 97
98 x1,y1,y1p = [],[],[]98 x1,y1,y1p = [],[],[]
@@ -102,7 +102,7 @@ class taskonset(task): · 3 unmodified lines
102 self.lenofunc = len(ofunc) 102 self.lenofunc = len(ofunc)
103 self.maxofunc = max(ofunc)103 self.maxofunc = max(ofunc)
104 # onset detection function 104 # onset detection function
105 downtime = numarray.arange(len(ofunc))*self.params.step105 downtime = arange(len(ofunc))*self.params.step
106 oplot.append(Gnuplot.Data(downtime,ofunc,with='lines',title=self.params.onsetmode))106 oplot.append(Gnuplot.Data(downtime,ofunc,with='lines',title=self.params.onsetmode))
107 107
108 # detected onsets108 # detected onsets
@@ -111,8 +111,8 @@ class taskonset(task): · 2 unmodified lines
111 x1.append(i[0]*self.params.step)111 x1.append(i[0]*self.params.step)
112 y1.append(self.maxofunc)112 y1.append(self.maxofunc)
113 y1p.append(-self.maxofunc)113 y1p.append(-self.maxofunc)
114 #x1 = numarray.array(onsets)*self.params.step114 #x1 = array(onsets)*self.params.step
115 #y1 = self.maxofunc*numarray.ones(len(onsets))115 #y1 = self.maxofunc*ones(len(onsets))
116 if x1:116 if x1:
117 oplot.append(Gnuplot.Data(x1,y1,with='impulses'))117 oplot.append(Gnuplot.Data(x1,y1,with='impulses'))
118 wplot.append(Gnuplot.Data(x1,y1p,with='impulses'))118 wplot.append(Gnuplot.Data(x1,y1p,with='impulses'))
@@ -126,8 +126,8 @@ class taskonset(task): · 7 unmodified lines
126 self.title = "" #"(no ground truth)"126 self.title = "" #"(no ground truth)"
127 else:127 else:
128 t_onsets = aubio.txtfile.read_datafile(datafile)128 t_onsets = aubio.txtfile.read_datafile(datafile)
129 x2 = numarray.array(t_onsets).resize(len(t_onsets))129 x2 = array(t_onsets).resize(len(t_onsets))
130 y2 = self.maxofunc*numarray.ones(len(t_onsets))130 y2 = self.maxofunc*ones(len(t_onsets))
131 wplot.append(Gnuplot.Data(x2,y2,with='impulses'))131 wplot.append(Gnuplot.Data(x2,y2,with='impulses'))
132 132
133 tol = 0.050 133 tol = 0.050

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