code: def cleaningSineTracks(freqsTotal, minFrames):
      nFrames = freqsTotal.shape[0]
      begTrack = 0
      freqsClean = freqsTotal.copy()
  
      if nFrames > 0:
          f = 0
          nTracks = freqsTotal.shape[
              1
          ]  # we assume all frames have a fix number of tracks
  
          for t in range(nTracks):
              f = 0
              begTrack = f
  
              while f < nFrames - 1:
                  # // check if f is begin of track
                  if freqsClean[f][t] <= 0 and freqsClean[f + 1][t] > 0:
                      begTrack = f + 1
  
                  # clean track if shorter than min duration
                  if (
                      freqsClean[f][t] > 0 and freqsClean[f + 1][t] <= 0
                  ) and ((f - begTrack) < minFrames):
                      for i in range(begTrack, f + 1):
                          freqsClean[i][t] = 0
  
                  f += 1
  
      return freqsClean
  
file_path: essentia/test/src/unittests/synthesis/test_sinemodel_streaming.py
imports: from essentia_test import *
  import math
  import essentia
  import essentia.streaming
  import essentia.standard
label_desc: Use image node_id 2 for calling a global function with example usage: cleaningSineTracks(freqsTotal, minFrames) and returns: freqsClean