History

update bench-pitch-isolated update bench-pitch-isolated

Paul Brossier committed 20 years ago

Commit b965fb11 parent e31ac281 file · +22 −23Browse files

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

Unified · Split

python/test/bench/pitch/bench-pitch-isolatedrenamed from python/test/bench/pitch/bench-pitch+22−23
@@ -47,7 +47,7 @@ class benchpitch(bench): · 46 unmodified lines
4747 #print results#, computed_data
4848 #print input, results, results - float(input.split('.')[-2])
4949
50− def run_bench(self,modes=['schmitt']):
50+ def run_bench(self,modes=['schmitt'],multiplot=0):
5151 from os.path import basename
5252 self.modes = modes
5353 self.pretty_titles()
@@ -90,12 +90,12 @@ class benchpitch(bench): · 36 unmodified lines
9090 allMpit,
9191 plottitle="%s %s" % (self.v['mode'],self.params.bufsize),
9292 plotmode='lines')
93+ """
9394 self.plotpitchtessiture(plot,
9495 truth,
9596 allMchr,
9697 plottitle="%s %s" % (self.v['mode'],"%12"),
9798 plotmode='lines')
98− """
9999 self.plotpitchtessiture(plot,
100100 truth,
101101 allMsil,
@@ -103,17 +103,20 @@ class benchpitch(bench): · 1 unmodified line
103103 plotmode='lines')
104104 """
105105 title = basename(self.datadir)
106− d.append(plot)
106+ if multiplot:
107+ d.append(plot)
108+ else:
109+ d += plot
107110 outplot = "_-_".join(('pitchtessiture',title))
108− self.xmin = 20. #min(self.v['truth'])
109− self.xmax = 110. #max(self.v['truth'])
110− for ext in ('ps','png','svg',''):
111+ self.xmin = min(self.v['truth']) #20.
112+ self.xmax = max(self.v['truth'])
113+ for ext in ('ps','png','svg'): #,''):
111114 self.plotplotpitchtessiture(d,
112115 plottitle="".join(['Performance against MIDI Note number (',
113116 title,
114117 ", %s" % len(self.sndlist), " samples)"]),
115118 outplot=outplot,
116− extension=ext)
119+ extension=ext,multiplot=multiplot)
117120 #d.append('beta = .25,orig(x) title \"-2 octave\"')
118121 #d.append('beta = .50,orig(x) title \"-1 octave\"')
119122 #d.append('beta = 1.0,orig(x) title \"original\"')
@@ -132,28 +135,23 @@ class benchpitch(bench): · 12 unmodified lines
132135 g = gnuplot_create(outplot=outplot,extension=extension)
133136 #g.title(plottitle)
134137 #g('orig(x) = beta*x')
135− #g.xlabel('original pitch (Hz)')
136− #g.ylabel('detected pitch (Hz)')
137− #g('set key left top')
138− #g('set log xy')
139− #g('set xrange [50:2000]')
140− g('set yrange [0:100]')
138+ g.title(plottitle)
139+ g('set yrange [50:100]')
140+ # erase axis
141+ g('set xrange [%f:%f]' % (self.xmin,self.xmax)) #(self.xmax - (self.xmax-self.xmin)*5./4.,self.xmax))
141142 #g.plot(*d)
143+ g('set border 3')
144+ g('set xtics nomirror')
145+ g('set ytics nomirror')
146+ g('set key bottom')
142147 if multiplot:
143148 g('set multiplot')
144149 for i in range(len(d)):
145150 # plot onset detection functions
146151 g('set size 1,%f' % ( 1.0/float(len(d)) ) )
147152 g('set origin 0,%f' % ( 1.0*float(len(d)-i-1)/float(len(d)) ) )
148− # erase axis
149− g('set border 3')
150− g('set xtics nomirror')
151− g('set ytics nomirror')
152− g('set key left top')
153− g('set xrange [%f:%f]' % (self.xmin,self.xmax)) #(self.xmax - (self.xmax-self.xmin)*5./4.,self.xmax))
154153 #g.ylabel('%Correct detections')
155− if i == len(d)-1:
156− g.xlabel(plottitle)
154+ g('set xrange [%f:%f]' % (self.xmin,self.xmax)) #(self.xmax - (self.xmax-self.xmin)*5./4.,self.xmax))
157155 g.plot(*d[i])
158156 g('unset title')
159157 g('unset multiplot')
@@ -168,11 +166,12 @@ if __name__ == "__main__": · 8 unmodified lines
168166 if len(sys.argv) > 2:
169167 for each in sys.argv[3:-1]: print each
170168 modes = ['schmitt', 'yin', 'yinfft', 'mcomb', 'fcomb']
169+ #modes = ['mcomb']
171170
172171 params = taskparams()
173− params.bufsize = 2048 #4096
172+ params.bufsize = 2048 # 4096
174173 params.hopsize = 256
175− params.silence = -70.
174+ params.silence = -60.
176175 params.pitchsmooth = 0
177176 params.pitchmax = 20000
178177 params.pitchmin = 20

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