code: def testSyntheticNoveltyCurve(self):
      # in this test we assume the noveltyCurve is a perfect sine. The algorithm
      # should reproduce a sinusoid with peaks at the same positions as those
      # from the fake noveltycurve. Ploting may help to understand...
      frameSize = 4  # 4 seconds
      overlap = 2
      frameRate = 44100 / 128.0
      f = 10  # Hz
      f = (
          f
          * float(frameRate)
          / nextPowerTwo(int(ceil(frameSize * frameRate)))
      )
      expectedBpm = f * 60.0  # 101Bpm
  
      length = 3000
      noveltyCurve = [
          numpy.sin(
              2.0 * numpy.pi * f * x / frameRate + 0.135 * numpy.pi
          )
          for x in range(length)
      ]
      for idx, x in enumerate(noveltyCurve):
          if x < 0:
              noveltyCurve[idx] = 0
      pool = self.computeBpmHistogram(
          noveltyCurve, frameSize, overlap, frameRate
      )
  
      # plot(noveltyCurve)
      # plot(pool['sinusoid'],'r')
      # show()
  
      noveltyPeaks = PeakDetection(interpolate=False)(noveltyCurve)[0]
      sinusoidPeaks = PeakDetection(interpolate=False)(
          pool["sinusoid"]
      )[0]
  
      # depending on the framesize, hopsize, etc. the sinusoid is usually
      # larger than the novelty curve, so we need to trim the sinusoid's
      # peaks
      sinusoidPeaks = PeakDetection()(pool["sinusoid"])[0][
          : len(noveltyPeaks)
      ]
      for p1, p2 in zip(noveltyPeaks, sinusoidPeaks):
          self.assertAlmostEqual(fabs(p1 - p2), 0, 5e-2)
      self.assertAlmostEqual(pool["bpm"], expectedBpm, 1e-3)
  
file_path: essentia/test/src/unittests/rhythm/test_bpmhistogram.py
imports: from essentia_test import *
  import essentia
  from essentia import Pool
  from essentia.standard import *
  import essentia.streaming
  from math import ceil, fabs
  from numpy import argmax
label_desc: Use image node_id 3 for calling the TestBpmHistogram obj's underlying member method code with example usage: obj.testSyntheticNoveltyCurve() without return types