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","]",")"]
docstr: Add onset peak-picking related arguments to an existing parser.
  
  Parameters
  ----------
  parser : argparse parser instance
      Existing argparse parser object.
  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.
  
  Returns
  -------
  parser_group : argparse argument group
      Onset peak-picking argument parser group.
  
  Notes
  -----
  Parameters are included in the group only if they are not 'None'.
docstr_tok: ["Add","onset","peak-picking","related","arguments","to","an","existing","parser",".","Parameters","--","--","--","--","--","parser",":","argparse","parser","instance","Existing","argparse","parser","object",".","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",".","Returns","--","--","--","-","parser_group",":","argparse","argument","group","Onset","peak-picking","argument","parser","group",".","Notes","--","--","-","Parameters","are","included","in","the","group","only","if","they","are","not","'None","'","."]
code: def add_arguments(
      parser,
      threshold=THRESHOLD,
      smooth=None,
      pre_avg=None,
      post_avg=None,
      pre_max=None,
      post_max=None,
      combine=COMBINE,
      delay=DELAY,
  ):
      """
      Add onset peak-picking related arguments to an existing parser.
  
      Parameters
      ----------
      parser : argparse parser instance
          Existing argparse parser object.
      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.
  
      Returns
      -------
      parser_group : argparse argument group
          Onset peak-picking argument parser group.
  
      Notes
      -----
      Parameters are included in the group only if they are not 'None'.
  
      """
      # add onset peak-picking related options to the existing parser
      g = parser.add_argument_group("peak-picking arguments")
      g.add_argument(
          "-t",
          dest="threshold",
          action="store",
          type=float,
          default=threshold,
          help="detection threshold [default=%(default).2f]",
      )
      if smooth is not None:
          g.add_argument(
              "--smooth",
              action="store",
              type=float,
              default=smooth,
              help="smooth the activation function over N "
              "seconds [default=%(default).2f]",
          )
      if pre_avg is not None:
          g.add_argument(
              "--pre_avg",
              action="store",
              type=float,
              default=pre_avg,
              help="build average over N previous seconds "
              "[default=%(default).2f]",
          )
      if post_avg is not None:
          g.add_argument(
              "--post_avg",
              action="store",
              type=float,
              default=post_avg,
              help="build average over N following seconds "
              "[default=%(default).2f]",
          )
      if pre_max is not None:
          g.add_argument(
              "--pre_max",
              action="store",
              type=float,
              default=pre_max,
              help="search maximum over N previous seconds "
              "[default=%(default).2f]",
          )
      if post_max is not None:
          g.add_argument(
              "--post_max",
              action="store",
              type=float,
              default=post_max,
              help="search maximum over N following seconds "
              "[default=%(default).2f]",
          )
      if combine is not None:
          g.add_argument(
              "--combine",
              action="store",
              type=float,
              default=combine,
              help="combine events within N seconds "
              "[default=%(default).2f]",
          )
      if delay is not None:
          g.add_argument(
              "--delay",
              action="store",
              type=float,
              default=delay,
              help="report the events N seconds delayed "
              "[default=%(default)i]",
          )
      # return the argument group so it can be modified if needed
      return g
  
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 5 for calling the OnsetPeakPickingProcessor obj's underlying member method code with example usage: obj.add_arguments(parser, threshold, smooth, pre_avg, post_avg, pre_max, post_max, combine, delay) and returns: g