code: def testRegressionSyntheticInput(self):
      # Use synthetic audio for Regression Test. This keeps NPY files size low.
      # Define parameters :
      hopSize = 128
      frameSize = 2048
      sampleRate = 44100
      guessUnvoiced = True
  
      # Create our algorithms:
      run_windowing = Windowing(
          type="hann", zeroPadding=3 * frameSize
      )  # Hann window with x4 zero padding
      run_spectrum = Spectrum(size=frameSize * 4)
      run_spectral_peaks = SpectralPeaks(
          minFrequency=1,
          maxFrequency=20000,
          maxPeaks=100,
          sampleRate=sampleRate,
          magnitudeThreshold=0,
          orderBy="magnitude",
      )
      run_pitch_salience_function = PitchSalienceFunction()
      run_pitch_salience_function_peaks = PitchSalienceFunctionPeaks()
  
      signalSize = frameSize * 10
      # Here are generated sine waves for each note of the scale, e.g. C3 is 130.81 Hz, etc
      c3 = 0.5 * numpy.sin(
          (array(range(signalSize)) / 44100.0) * 130.81 * 2 * math.pi
      )
      d3 = 0.5 * numpy.sin(
          (array(range(signalSize)) / 44100.0) * 146.83 * 2 * math.pi
      )
      e3 = 0.5 * numpy.sin(
          (array(range(signalSize)) / 44100.0) * 164.81 * 2 * math.pi
      )
      f3 = 0.5 * numpy.sin(
          (array(range(signalSize)) / 44100.0) * 174.61 * 2 * math.pi
      )
      g3 = 0.5 * numpy.sin(
          (array(range(signalSize)) / 44100.0) * 196.00 * 2 * math.pi
      )
      a3 = 0.5 * numpy.sin(
          (array(range(signalSize)) / 44100.0) * 220.00 * 2 * math.pi
      )
      b3 = 0.5 * numpy.sin(
          (array(range(signalSize)) / 44100.0) * 246.94 * 2 * math.pi
      )
      c4 = 0.5 * numpy.sin(
          (array(range(signalSize)) / 44100.0) * 261.63 * 2 * math.pi
      )
  
      # This signal is a "major scale ladder"
      scale = concatenate([c3, d3, e3, f3, g3, a3, b3, c4])
  
      # Now we are ready to start processing.
      # 1. Load audio and pass it through the equal-loudness filter
      audio = EqualLoudness()(scale)
  
      # 2. Cut audio into frames and compute for each frame:
      #    spectrum -> spectral peaks -> pitch salience function -> pitch salience function peaks
  
      # Do some spot checks on selected frequemtly occuring peaks in selected bin ranges.
      expectedBins1 = [170.0, 50.0, 98.0, 222.0, 32.0]  # 168 to 313
      expectedBins2 = [
          220.0,
          100.0,
          30.0,
          167.0,
          260.0,
          47.0,
          140.0,
          70.0,
      ]  # 649 to 794
      expectedBins3 = [
          240.0,
          120.0,
          50.0,
          0.0,
          276.0,
          194.0,
          156.0,
          74.0,
          86.0,
          36.0,
      ]  # 807 bins 953
      expectedBins4 = [
          260.0,
          140.0,
          70.0,
          20.0,
          101.0,
          293.0,
          220.0,
          173.0,
          53.0,
      ]  # 968 to 1112
  
      index = 0
      for frame in FrameGenerator(
          audio, frameSize=frameSize, hopSize=hopSize
      ):
          frame = run_windowing(frame)
          spectrum = run_spectrum(frame)
          peak_frequencies, peak_magnitudes = run_spectral_peaks(
              spectrum
          )
          salience = run_pitch_salience_function(
              peak_frequencies, peak_magnitudes
          )
          salience_peaks_bins, _ = run_pitch_salience_function_peaks(
              salience
          )
  
          if (index >= 168) and index < 313:
              self.assertEqualVector(expectedBins1, salience_peaks_bins)
          elif (index >= 649) and index < 794:
              self.assertEqualVector(expectedBins2, salience_peaks_bins)
          elif (index >= 807) and index < 953:
              self.assertEqualVector(expectedBins3, salience_peaks_bins)
          elif (index >= 968) and index < 1112:
              self.assertEqualVector(expectedBins4, salience_peaks_bins)
          index += 1
  
file_path: essentia/test/src/unittests/tonal/test_pitchsaliencefunctionpeaks.py
imports: from essentia_test import *
  from numpy import *
label_desc: Use image node_id 16 for calling the TestPitchSalienceFunctionPeaks obj's underlying member method code with example usage: obj.testRegressionSyntheticInput() without return types