code: def testRegression(self):
      # frequencies should be in ascendent order
      f0 = 110
      freqs = [0.5, 0.75, 1.0, 2.0, 3.5, 4, 4.2, 4.9, 6]
      freqs = [freq * f0 for freq in freqs]
      mags = ones(len(freqs))
      self.assertAlmostEqual(
          Inharmonicity()(freqs, mags), 0.122222222388
      )
  
      semitones = [0.5, 0.75, 12.5, 14.0, 24.1]
      freqs = [pow(2.0, s / 12.0) * f0 for s in semitones]
      mags = ones(len(freqs))
      self.assertAlmostEqual(
          Inharmonicity()(freqs, mags), 0.0573841929436
      )
  
      from random import random
  
      semitones = [(1 + random()) * i for i in range(10)]
      semitones.sort()
      freqs = [pow(2.0, s / 12.0) * f0 for s in semitones]
      mags = ones(len(freqs))
      self.assertTrue(Inharmonicity()(freqs, mags) > 0)
  
file_path: essentia/test/src/unittests/tonal/test_inharmonicity.py
imports: from essentia_test import *
label_desc: Use image node_id 3 for calling the TestInharmonicity obj's underlying member method code with example usage: obj.testRegression() without return types