Showing the changes to python (1 of 1 file). Show all
Unified · Split
| @@ -92,7 +92,7 @@ class taskonset(task): · 91 unmodified lines | |||
| 92 | import Gnuplot, Gnuplot.funcutils | 92 | import Gnuplot, Gnuplot.funcutils |
| 93 | import aubio.txtfile | 93 | import aubio.txtfile |
| 94 | import os.path | 94 | import os.path |
| 95 | import numarray | 95 | from numpy import arange, array, ones |
| 96 | from aubio.onsetcompare import onset_roc | 96 | 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.step | 105 | 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 onsets | 108 | # 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.step | 114 | #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 |