code: def superflux(spectrogram, diff_frames=None, diff_max_bins=3):
      """
      SuperFlux method with a maximum filter vibrato suppression stage.
  
      Calculates the difference of bin k of the magnitude spectrogram relative to
      the N-th previous frame with the maximum filtered spectrogram.
  
      Parameters
      ----------
      spectrogram : :class:`Spectrogram` instance
          Spectrogram instance.
      diff_frames : int, optional
          Number of frames to calculate the diff to.
      diff_max_bins : int, optional
          Number of bins used for maximum filter.
  
      Returns
      -------
      superflux : numpy array
          SuperFlux onset detection function.
  
      Notes
      -----
      This method works only properly, if the spectrogram is filtered with a
      filterbank of the right frequency spacing. Filter banks with 24 bands per
      octave (i.e. quarter-tone resolution) usually yield good results. With
      `max_bins` = 3, the maximum of the bins k-1, k, k+1 of the frame
      `diff_frames` to the left is used for the calculation of the difference.
  
      References
      ----------
      .. [1] Sebastian Böck and Gerhard Widmer,
             "Maximum Filter Vibrato Suppression for Onset Detection",
             Proceedings of the 16th International Conference on Digital Audio
             Effects (DAFx), 2013.
  
      """
      from madmom.audio.spectrogram import SpectrogramDifference
  
      # if the diff of a spectrogram is given, do not calculate the diff twice
      if not isinstance(spectrogram, SpectrogramDifference):
          spectrogram = spectrogram.diff(
              diff_frames=diff_frames,
              diff_max_bins=diff_max_bins,
              positive_diffs=True,
          )
      # SuperFlux is the sum of all positive 1st order max. filtered differences
      return np.asarray(np.sum(spectrogram, axis=1))
  
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 6 for calling a global function with example usage: superflux(spectrogram, diff_frames, diff_max_bins) and returns: np