code: def testRegression(self):
      f0 = 110
      freqs = [0.5, 0.75, 1.0, 2.0, 3.5, 4.0, 4.09, 4.9, 6.25]
      freqs = [freq * f0 for freq in freqs]
      mags = ones(len(freqs))
      result = [1.0, 2.0, 3.0, 4.0, 4.9, 6.0, 7.0, 8.0, 9.0, 10.0]
      result_mags = [1, 1, 0, 1, 1, 0, 0, 0, 0, 0]
      result_freqs = [freq * f0 for freq in result]
  
      f, m = HarmonicPeaks(maxHarmonics=10)(freqs, mags, f0)
      self.assertAlmostEqualVector(f, result_freqs)
      self.assertEqualVector(m, result_mags)
  
      # in the case when two peaks are equidistant to an ideal harmonic
      # the peak with greater amplitude should be selected
      f0 = 110
      freqs = [1.0, 2.9, 3.1]
      mags = [1.0, 1.0, 0.5]
      freqs = [freq * f0 for freq in freqs]
  
      result = [1.0, 2.0, 2.9]
      result_mags = [1.0, 0.0, 1.0]
      result_freqs = [freq * f0 for freq in result]
  
      f, m = HarmonicPeaks(maxHarmonics=3)(freqs, mags, f0)
      self.assertAlmostEqualVector(f, result_freqs)
      self.assertEqualVector(m, result_mags)
  
file_path: essentia/test/src/unittests/tonal/test_harmonicpeaks.py
imports: from essentia_test import *
label_desc: Use image node_id 2 for calling the TestHarmonicPeaks obj's underlying member method code with example usage: obj.testRegression() without return types