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
9 sys.exit(1)9 sys.exit(1)
10 10
11 samplerate = 4410011 samplerate = 44100
12 win_s = 512 # fft size12 win_s = 1024 # fft size
13 hop_s = win_s / 2 # block size13 hop_s = win_s / 4 # block size
14 threshold = 0.2614 threshold = 0.5
15 15
16 f = source(sys.argv[1], samplerate, hop_s)16 f = source(sys.argv[1], samplerate, hop_s)
17 g = sink(sys.argv[2], samplerate)17 g = sink(sys.argv[2], samplerate)
18 h = sink(sys.argv[3], samplerate)18 h = sink(sys.argv[3], samplerate)
19 19
20 pv = pvoc(win_s, hop_s) # phase vocoder20 pva = pvoc(win_s, hop_s) # a phase vocoder
21 pw = pvoc(win_s, hop_s) # another phase vocoder21 pvb = pvoc(win_s, hop_s) # another phase vocoder
22 t = tss(win_s, hop_s) # transient steady state separation22 t = tss(win_s, hop_s) # transient steady state separation
23 23
24 t.set_threshold(threshold)24 t.set_threshold(threshold)
@@ -27,10 +27,10 @@ if __name__ == '__main__': · 2 unmodified lines
27 27
28 while read:28 while read:
29 samples, read = f() # read file29 samples, read = f() # read file
30 spec = pv(samples) # compute spectrum30 spec = pva(samples) # compute spectrum
31 trans_spec, stead_spec = t(spec) # transient steady-state separation31 trans_spec, stead_spec = t(spec) # transient steady-state separation
32 transients = pv.rdo(trans_spec) # overlap-add synthesis of transients32 transients = pva.rdo(trans_spec) # overlap-add synthesis of transients
33 steadstate = pw.rdo(stead_spec) # overlap-add synthesis of steady states33 steadstate = pvb.rdo(stead_spec) # overlap-add synthesis of steady states
34 g(transients, read) # write transients to output34 g(transients, read) # write transients to output
35 h(steadstate, read) # write steady states to output35 h(steadstate, read) # write steady states to output
36 36

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