History

added support for dcthreshold added support for dcthreshold

Paul Brossier committed 20 years ago

Commit 897b4551 parent ee7b9da1 file · +6 −1Browse files

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

Unified · Split

python/aubio/aubioclass.py+6−1
@@ -77,7 +77,7 @@ class peakpick: · 76 unmodified lines
7777
7878 class onsetpick:
7979 """ superclass for aubio_pvoc + aubio_onsetdetection + aubio_peakpicker """
80− def __init__(self,bufsize,hopsize,channels,myvec,threshold,mode='dual',derivate=False):
80+ def __init__(self,bufsize,hopsize,channels,myvec,threshold,mode='dual',derivate=False,dcthreshold=0):
8181 self.myfft = cvec(bufsize,channels)
8282 self.pv = pvoc(bufsize,hopsize,channels)
8383 if mode in ['dual'] :
@@ -91,6 +91,7 @@ class onsetpick: · 7 unmodified lines
9191 self.mode = mode
9292 self.pp = peakpick(float(threshold))
9393 self.derivate = derivate
94+ self.dcthreshold = dcthreshold
9495 self.oldval = 0.
9596
9697 def do(self,myvec):
@@ -105,6 +106,10 @@ class onsetpick: · 8 unmodified lines
105106 self.oldval = val
106107 if dval > 0: self.myonset.set(dval,0,0)
107108 else: self.myonset.set(0.,0,0)
109+ if self.dcthreshold:
110+ dval = self.myonset.get(0,0) - self.dcthreshold
111+ if dval > 0: self.myonset.set(dval,0,0)
112+ else: self.myonset.set(0.,0,0)
108113 return self.pp.do(self.myonset),self.myonset.get(0,0)
109114
110115 class pitchdetection:

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