code: def testSinglePeakNonDefaultBR(self):
      # Same as above, but tweaking the Bin Resolution to ensure output length is consistant
      # Larger bin resolution reduces the number of non zero values in salience function
      binResolution = 40
      freq_speaks = [55]
      mag_speaks = [1]
      outputLength = int(6000 / binResolution)
      # Length of the non-zero values for this Pitch Salience = 3
      expectedPitchSalience = [
          1.0000000e00,
          5.0000000e-01,
          3.7493994e-33,
      ]
      # Append zeros to expected salience
      expectedPitchSalience += [0] * (outputLength - 3)
  
      calculatedPitchSalience = PitchSalienceFunction(
          binResolution=binResolution
      )(freq_speaks, mag_speaks)
      self.assertEqual(len(calculatedPitchSalience), outputLength)
      # Check the first 3 elements. The first has value "1".
      # The next returned 3 non-zero values decreasing in magnitude, should match "expected" above.
      self.assertAlmostEqualVectorFixedPrecision(
          calculatedPitchSalience, expectedPitchSalience, 8
      )
  
imports: from essentia_test import *
  from numpy import *
label_desc: Use image node_id 4 for calling the TestPitchSalienceFunction obj's underlying member method code with example usage: obj.testSinglePeakNonDefaultBR() without return types