code: def testSinglePeak(self):
      # Provide a single input peak with a unit magnitude at the reference frequency, and
      # validate that the output salience function has only one non-zero element at the first bin.
      # N.B: default value for bin Resolution is 10.
      freq_speaks = [55]
      mag_speaks = [1]
      outputLength = 600  # calculated by fiveOctaveFullRange/binResolution = 6000/10
      # Length of the non-zero values for this Pitch Salience = 11
      expectedPitchSalience = [
          1.0000000e00,
          9.7552824e-01,
          9.0450847e-01,
          7.9389262e-01,
          6.5450847e-01,
          5.0000000e-01,
          3.4549147e-01,
          2.0610739e-01,
          9.5491491e-02,
          2.4471754e-02,
          3.7493994e-33,
      ]
      # Append zeros to expected salience
      expectedPitchSalience += [0] * (outputLength - 11)
  
      calculatedPitchSalience = PitchSalienceFunction()(
          freq_speaks, mag_speaks
      )
      self.assertEqual(len(calculatedPitchSalience), outputLength)
      # Check the first 11 elements. The first element has value "1".
      # The next returned 10 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 3 for calling the TestPitchSalienceFunction obj's underlying member method code with example usage: obj.testSinglePeak() without return types