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