History

python/demos/demo_tss.py: improve default parameters

Paul Brossier committed 13 years ago

Commit 31844681 parent 6d3777a1 file · +8 −8Browse files

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

Unified · Split

python/demos/demo_tss.py+8−8
@@ -9,16 +9,16 @@ if __name__ == '__main__': · 8 unmodified lines
99 sys.exit(1)
1010
1111 samplerate = 44100
12− win_s = 512 # fft size
13− hop_s = win_s / 2 # block size
14− threshold = 0.26
12+ win_s = 1024 # fft size
13+ hop_s = win_s / 4 # block size
14+ threshold = 0.5
1515
1616 f = source(sys.argv[1], samplerate, hop_s)
1717 g = sink(sys.argv[2], samplerate)
1818 h = sink(sys.argv[3], samplerate)
1919
20− pv = pvoc(win_s, hop_s) # phase vocoder
21− pw = pvoc(win_s, hop_s) # another phase vocoder
20+ pva = pvoc(win_s, hop_s) # a phase vocoder
21+ pvb = pvoc(win_s, hop_s) # another phase vocoder
2222 t = tss(win_s, hop_s) # transient steady state separation
2323
2424 t.set_threshold(threshold)
@@ -27,10 +27,10 @@ if __name__ == '__main__': · 2 unmodified lines
2727
2828 while read:
2929 samples, read = f() # read file
30− spec = pv(samples) # compute spectrum
30+ spec = pva(samples) # compute spectrum
3131 trans_spec, stead_spec = t(spec) # transient steady-state separation
32− transients = pv.rdo(trans_spec) # overlap-add synthesis of transients
33− steadstate = pw.rdo(stead_spec) # overlap-add synthesis of steady states
32+ transients = pva.rdo(trans_spec) # overlap-add synthesis of transients
33+ steadstate = pvb.rdo(stead_spec) # overlap-add synthesis of steady states
3434 g(transients, read) # write transients to output
3535 h(steadstate, read) # write steady states to output
3636

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