class_docstr: This class implements the onset peak-picking functionality.
  It transparently converts the chosen values from seconds to frames.
  
  Parameters
  ----------
  threshold : float
      Threshold for peak-picking.
  smooth : float, optional
      Smooth the activation function over `smooth` seconds.
  pre_avg : float, optional
      Use `pre_avg` seconds past information for moving average.
  post_avg : float, optional
      Use `post_avg` seconds future information for moving average.
  pre_max : float, optional
      Use `pre_max` seconds past information for moving maximum.
  post_max : float, optional
      Use `post_max` seconds future information for moving maximum.
  combine : float, optional
      Only report one onset within `combine` seconds.
  delay : float, optional
      Report the detected onsets `delay` seconds delayed.
  online : bool, optional
      Use online peak-picking, i.e. no future information.
  fps : float, optional
      Frames per second used for conversion of timings.
  
  Returns
  -------
  onsets : numpy array
      Detected onsets [seconds].
  
  Notes
  -----
  If no moving average is needed (e.g. the activations are independent of
  the signal's level as for neural network activations), `pre_avg` and
  `post_avg` should be set to 0.
  For peak picking of local maxima, set `pre_max` >= 1. / `fps` and
  `post_max` >= 1. / `fps`.
  For online peak picking, all `post_` parameters are set to 0.
  
  References
  ----------
  .. [1] Sebastian Böck, Florian Krebs and Markus Schedl,
         "Evaluating the Online Capabilities of Onset Detection Methods",
         Proceedings of the 13th International Society for Music Information
         Retrieval Conference (ISMIR), 2012.
  
  Examples
  --------
  Create a PeakPickingProcessor. The returned array represents the positions
  of the onsets in seconds, thus the expected sampling rate has to be given.
  
  >>> proc = OnsetPeakPickingProcessor(fps=100)
  >>> proc  # doctest: +ELLIPSIS
  <madmom.features.onsets.OnsetPeakPickingProcessor object at 0x...>
  
  Call this OnsetPeakPickingProcessor with the onset activation function from
  an RNNOnsetProcessor to obtain the onset positions.
  
  >>> act = RNNOnsetProcessor()('tests/data/audio/sample.wav')
  >>> proc(act)  # doctest: +ELLIPSIS
  array([0.09, 0.29, 0.45, ..., 2.34, 2.49, 2.67])
class_docstr_tok: ["This","class","implements","the","onset","peak-picking","functionality",".","It","transparently","converts","the","chosen","values","from","seconds","to","frames",".","Parameters","--","--","--","--","--","threshold",":","float","Threshold","for","peak-picking",".","smooth",":","float",",","optional","Smooth","the","activation","function","over","`","smooth","`","seconds",".","pre_avg",":","float",",","optional","Use","`","pre_avg","`","seconds","past","information","for","moving","average",".","post_avg",":","float",",","optional","Use","`","post_avg","`","seconds","future","information","for","moving","average",".","pre_max",":","float",",","optional","Use","`","pre_max","`","seconds","past","information","for","moving","maximum",".","post_max",":","float",",","optional","Use","`","post_max","`","seconds","future","information","for","moving","maximum",".","combine",":","float",",","optional","Only","report","one","onset","within","`","combine","`","seconds",".","delay",":","float",",","optional","Report","the","detected","onsets","`","delay","`","seconds","delayed",".","online",":","bool",",","optional","Use","online","peak-picking",",","i.e",".","no","future","information",".","fps",":","float",",","optional","Frames","per","second","used","for","conversion","of","timings",".","Returns","--","--","--","-","onsets",":","numpy","array","Detected","onsets","[","seconds","]",".","Notes","--","--","-","If","no","moving","average","is","needed","(","e.g",".","the","activations","are","independent","of","the","signal","'s","level","as","for","neural","network","activations",")",",","`","pre_avg","`","and","`","post_avg","`","should","be","set","to","0",".","For","peak","picking","of","local","maxima",",","set","`","pre_max","`",">","=","1",".","\/","`","fps","`","and","`","post_max","`",">","=","1",".","\/","`","fps","`",".","For","online","peak","picking",",","all","`","post_","`","parameters","are","set","to","0",".","References","--","--","--","--","--","..","[","1","]","Sebastian","B\u00f6ck",",","Florian","Krebs","and","Markus","Schedl",",","``","Evaluating","the","Online","Capabilities","of","Onset","Detection","Methods","''",",","Proceedings","of","the","13th","International","Society","for","Music","Information","Retrieval","Conference","(","ISMIR",")",",","2012",".","Examples","--","--","--","--","Create","a","PeakPickingProcessor",".","The","returned","array","represents","the","positions","of","the","onsets","in","seconds",",","thus","the","expected","sampling","rate","has","to","be","given",".",">",">",">","proc","=","OnsetPeakPickingProcessor","(","fps=100",")",">",">",">","proc","#","doctest",":","+ELLIPSIS","<","madmom.features.onsets.OnsetPeakPickingProcessor","object","at","0x","...",">","Call","this","OnsetPeakPickingProcessor","with","the","onset","activation","function","from","an","RNNOnsetProcessor","to","obtain","the","onset","positions",".",">",">",">","act","=","RNNOnsetProcessor","(",")","(","'tests\/data\/audio\/sample.wav","'",")",">",">",">","proc","(","act",")","#","doctest",":","+ELLIPSIS","array","(","[","0.09",",","0.29",",","0.45",",","...",",","2.34",",","2.49",",","2.67","]",")"]
code: def __init__(
      self,
      threshold=THRESHOLD,
      smooth=SMOOTH,
      pre_avg=PRE_AVG,
      post_avg=POST_AVG,
      pre_max=PRE_MAX,
      post_max=POST_MAX,
      combine=COMBINE,
      delay=DELAY,
      online=ONLINE,
      fps=FPS,
      **kwargs,
  ):
      # pylint: disable=unused-argument
      # instantiate OnlineProcessor
      super(OnsetPeakPickingProcessor, self).__init__(online=online)
      if self.online:
          # set some parameters to 0 (i.e. no future information available)
          smooth = 0
          post_avg = 0
          post_max = 0
          # init buffer
          self.buffer = None
          self.counter = 0
          self.last_onset = None
      # save parameters
      self.threshold = threshold
      self.smooth = smooth
      self.pre_avg = pre_avg
      self.post_avg = post_avg
      self.pre_max = pre_max
      self.post_max = post_max
      self.combine = combine
      self.delay = delay
      self.fps = fps
  
imports: from __future__ import absolute_import, division, print_function
  import numpy
  from scipy.ndimage import maximum_filter, minimum_filter, uniform_filter
  from ..audio.signal import smooth
  from ..processors import BufferProcessor, OnlineProcessor, ParallelProcessor, SequentialProcessor
  from ..utils import combine_events
label_desc: Use image node_id 1 to create a new OnsetPeakPickingProcessor object from inherited base classes: OnlineProcessor with example: obj = OnsetPeakPickingProcessor(threshold, smooth, pre_avg, post_avg, pre_max, post_max, combine, delay, online, fps)