class_docstr: Onset Detection Function analyzer
class_docstr_tok: ["Onset","Detection","Function","analyzer"]
code: def post_process(self):
      # spectrogram = self.parents()[0]['spectrogram_analyzer'].data
      results = self.process_pipe.results
      parent_uuid = self.parents["spectrogram"].uuid()
      spectrogram = results[parent_uuid]["spectrogram_analyzer"].data
      # spectrogram = self.pipe._results[self.parents()[0].id]
  
      # Low-pass filtering of the spectrogram amplitude along the time axis
      S = signal.lfilter(
          signal.hann(15)[8:], 1, abs(spectrogram), axis=0
      )
  
      # Clip small value to a minimal threshold
      np.maximum(S, 1e-9, out=S)
  
      S = np.log10(S)
  
      #        plt.figure()
      #        plt.imshow(S,origin='lower', aspect='auto', interpolation='nearest')
      #        plt.show()
  
      # S[S<1e-3]=0
      np.maximum(S, 1e-3, out=S)
  
      # Differentiator filter
      df_filter = signal.fir_filter_design.remez(
          31, [0, 0.5], [Pi], type="differentiator"
      )
  
      S_diff = signal.lfilter(df_filter, 1, S, axis=0)
      S_diff[S_diff < 1e-10] = 0
  
      # Summation along the frequency axis
      odf_diff = S_diff.sum(axis=1)
      odf_median = np.median(odf_diff)
      if odf_median:
          odf_diff = odf_diff / odf_median  # Normalize
  
      odf = self.new_result(data_mode="value", time_mode="framewise")
      # odf.parameters = {'FFT_SIZE': self.FFT_SIZE}
      odf.data_object.value = odf_diff
      self.add_result(odf)
  
file_path: TimeSide/timeside/plugins/analyzer/odf.py
imports: from timeside.core import implements, interfacedoc
  from timeside.core.analyzer import Analyzer
  from .spectrogram import Spectrogram
  from timeside.core.api import IAnalyzer
  import numpy
  from numpy import pi
  from scipy import signal
  from timeside.core.tools.parameters import store_parameters, Int, HasTraits
  from timeside.core.grapher import DisplayAnalyzer
label_desc: Use image node_id 8 for calling the OnsetDetectionFunction obj's underlying member method code with example usage: obj.post_process() without return types