Changeset 897b455


Ignore:
Timestamp:
Feb 26, 2006, 6:29:23 PM (19 years ago)
Author:
Paul Brossier <piem@altern.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
ea98179
Parents:
ee7b9da
Message:

added support for dcthreshold
added support for dcthreshold

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/aubio/aubioclass.py

    ree7b9da r897b455  
    7878class 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)
     
    9292        self.pp       = peakpick(float(threshold))
    9393        self.derivate = derivate
     94        self.dcthreshold = dcthreshold
    9495        self.oldval   = 0.
    9596
     
    104105                dval        = val - self.oldval
    105106                self.oldval = val
     107                if dval > 0: self.myonset.set(dval,0,0)
     108                else:  self.myonset.set(0.,0,0)
     109        if self.dcthreshold:
     110                dval        = self.myonset.get(0,0) - self.dcthreshold
    106111                if dval > 0: self.myonset.set(dval,0,0)
    107112                else:  self.myonset.set(0.,0,0)
Note: See TracChangeset for help on using the changeset viewer.