History

fix signal buffer size for demo-tempo-acf fix signal buffer size for demo-tempo-acf

Paul Brossier committed 20 years ago

Commit 9c3b6961 parent 5ce98d81 file · +4 −4Browse files

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

Unified · Split

python/test/bench/tempo/demo-tempo-acf+4−4
@@ -76,7 +76,7 @@ rayparam = 48/512.*winlen · 75 unmodified lines
7676 t = [i for i in range(hopsize)]
7777 #tlong = [i for i in range(hopsize*(btstep-1))]
7878 #tall = [i for i in range(hopsize*btstep)]
79−sig = [0 for i in range(hopsize*btstep)]
79+sig = [0 for i in range(hopsize*btstep*4)]
8080 dfx = [i for i in range(winlen)]
8181 dfframe = [0 for i in range(winlen)]
8282 dfrev = [0 for i in range(winlen)]
@@ -103,7 +103,7 @@ nrframe = 0 · 20 unmodified lines
103103 while (task.readsize == params.hopsize):
104104 task()
105105 #print task.pos2
106− sig[:-hopsize] = [i for i in sig[-(btstep-1)*hopsize:]]
106+ sig[:-hopsize] = [i for i in sig[-(btstep*4-1)*hopsize:]]
107107 sig[-hopsize:] = [task.myvec.get(i,0) for i in t]
108108
109109 #g('set xrange [%f:%f]' % (t[0],t[-1]))
@@ -118,7 +118,7 @@ while (task.readsize == params.hopsize): · 8 unmodified lines
118118 aubio_autocorr(task.dfframe(),acf());
119119 acframe = [acf.get(i,0) for i in range(winlen/2)]
120120 if printframe == nrframe or printframe == -1:
121− d = [[plotdata(range(btstep*hopsize),sig,plottitle="input signal", with='lines')]]
121+ d = [[plotdata(range(0,btstep*hopsize*4,4),sig[0:-1:4],plottitle="input signal", with='lines')]]
122122 d += [[plotdata(range(-winlen,0),dfframe,plottitle="onset detection", with='lines')]]
123123 d += [[plotdata(range(winlen/2),acframe,plottitle="autocorrelation", with='lines')]]
124124
@@ -133,7 +133,7 @@ while (task.readsize == params.hopsize): · 8 unmodified lines
133133
134134 f('set size %f,%f' % (1.0*xsize,0.33*ysize) )
135135 f('set orig %f,%f' % (0.0*xsize,0.66*ysize) )
136− f('set xrange [%f:%f]' % (0,btstep*hopsize) )
136+ f('set xrange [%f:%f]' % (0,btstep*hopsize*4) )
137137 f('set yrange [%f:%f]' % (-1.2*max(sig),1.2*max(sig)) )
138138 f.title('Input signal')
139139 f.xlabel('time (samples)')

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