code: def rectified_complex_domain(spectrogram, diff_frames=None):
      """
      Rectified Complex Domain.
  
      Parameters
      ----------
      spectrogram : :class:`Spectrogram` instance
          :class:`Spectrogram` instance.
      diff_frames : int, optional
          Number of frames to calculate the diff to.
  
      Returns
      -------
      rectified_complex_domain : numpy array
          Rectified complex domain onset detection function.
  
      References
      ----------
      .. [1] Simon Dixon,
             "Onset Detection Revisited",
             Proceedings of the 9th International Conference on Digital Audio
             Effects (DAFx), 2006.
  
      """
      # rectified complex domain
      rcd = _complex_domain(spectrogram)
      # only keep values where the magnitude rises
      pos_diff = spectrogram.diff(
          diff_frames=diff_frames, positive_diffs=True
      )
      rcd *= pos_diff.astype(bool)
      # take the sum of the absolute changes
      return np.asarray(np.sum(np.abs(rcd), 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 15 for calling a global function with example usage: rectified_complex_domain(spectrogram, diff_frames) and returns: np