code: def testImpulseTrain(self):
      # most of the code is borrowed from test_tempotap.py. Applying tempotaptics
      # to tempotap's output should yield tempotap's input (more or less)
      inputLength = 14200
      numberFrames = 1024
      featuresNumber = 1
      guessPeriod = 70
      guessPhase = 17
      hopSize = 256
  
      # create an impulse train of phase offset 17 and period 70
      features = zeros((inputLength, featuresNumber))
      i = int(math.floor(guessPhase))
      expected_nTicks = 0
      while i < len(features):
          features[i][0] = 1
          i += int(math.floor(guessPeriod))
          expected_nTicks += 1
  
      tempotap = TempoTap(
          numberFrames=numberFrames, frameHop=numberFrames
      )
  
      tempotapticks = TempoTapTicks(
          frameHop=numberFrames, hopSize=hopSize
      )
  
      ticks = []
      matching_periods = []
  
      for i in range(inputLength):
          periods, phases = tempotap(features[i])
          tmp = tempotapticks(periods, phases)
  
          ticks += list(tmp[0])
          matching_periods += list(tmp[1])
  
      # flush current buffer with zeros
      for i in range(inputLength % numberFrames, numberFrames):
          periods, phases = tempotap(features[i])
          tmp = tempotapticks(periods, phases)
  
          ticks += list(tmp[0])
          matching_periods += list(tmp[1])
  
      # some ticks get lost at the end, but we just want to check that the
      # ones we found are correct
      initial_guessed_phase = guessPhase * hopSize / 44100.0
      delta_guessed_phase = guessPeriod * hopSize / 44100.0
  
      for i in range(min(len(ticks), expected_nTicks)):
          self.assertAlmostEqual(
              ticks[i],
              initial_guessed_phase + delta_guessed_phase * i,
              1e-2,
          )
      for period in matching_periods:
          self.assertAlmostEqual(period, guessPeriod, 1e-2)
  
file_path: essentia/test/src/unittests/rhythm/test_tempotapticks.py
imports: from essentia_test import *
  import math
label_desc: Use image node_id 4 for calling the TestTempoTapTicks obj's underlying member method code with example usage: obj.testImpulseTrain() without return types