python/demos/demo_tss.py: improve default parameters
authorPaul Brossier <piem@piem.org>
Wed, 6 Mar 2013 21:36:01 +0000 (16:36 -0500)
committerPaul Brossier <piem@piem.org>
Wed, 6 Mar 2013 21:36:01 +0000 (16:36 -0500)
python/demos/demo_tss.py

index 0d670ce118e45b8b2aa45abf076c796af19738de..884dc9b501bac7fc8e8b733c2343f2e70441a33b 100755 (executable)
@@ -9,16 +9,16 @@ if __name__ == '__main__':
     sys.exit(1)
 
   samplerate = 44100
-  win_s = 512                 # fft size
-  hop_s = win_s / 2           # block size
-  threshold = 0.26
+  win_s = 1024      # fft size
+  hop_s = win_s / 4 # block size
+  threshold = 0.5
 
   f = source(sys.argv[1], samplerate, hop_s)
   g = sink(sys.argv[2], samplerate)
   h = sink(sys.argv[3], samplerate)
 
-  pv = pvoc(win_s, hop_s)     # phase vocoder
-  pw = pvoc(win_s, hop_s)     # another phase vocoder
+  pva = pvoc(win_s, hop_s)    # a phase vocoder
+  pvb = pvoc(win_s, hop_s)    # another phase vocoder
   t = tss(win_s, hop_s)       # transient steady state separation
 
   t.set_threshold(threshold)
@@ -27,10 +27,10 @@ if __name__ == '__main__':
 
   while read:
     samples, read = f()               # read file
-    spec = pv(samples)                # compute spectrum
+    spec = pva(samples)                # compute spectrum
     trans_spec, stead_spec = t(spec)  # transient steady-state separation
-    transients = pv.rdo(trans_spec)   # overlap-add synthesis of transients
-    steadstate = pw.rdo(stead_spec)   # overlap-add synthesis of steady states
+    transients = pva.rdo(trans_spec)   # overlap-add synthesis of transients
+    steadstate = pvb.rdo(stead_spec)   # overlap-add synthesis of steady states
     g(transients, read)               # write transients to output
     h(steadstate, read)               # write steady states to output