code: def testRegression(self):
      # After comparing the results of panning with jordi janner's matlab
      # code, we have concluded that although they are not the same exact
      # numbersi, the algorithm seems to show correct output. Differences may
      # be due to essentia not being compiled for doubles, or may com from
      # slight differences in fft outputs. Window types and/or sizes or
      # normalization seem not to be critical for the final result.
      # On this respect, files computed with essentia at the time of this
      # writing (11/11/2008) have been included in order to have a regression
      # test that passes the test.
  
      # 10/07/2013: We switched to different testing audio files and recomputed
      # the files with essentia assuming that Panning algo works correctly since
      # it seems no fixes were ever done to it since the original test (11/11/2008)
  
      # 2015-03-02: Recomputed the values again, as they are a bit different, probably
      #             due to changes introduced after switching to newer LibAV
  
      testdir = join(filedir(), "panning")
      expected = readMatrix(
          join(testdir, "essentia", "musicbox_essentia_panning.txt")
      )
  
      framesize = 8192
      hopsize = 2048
      zeropadding = 1
      sampleRate = 44100
  
      filename = join(testdata.audio_dir, "recorded", "musicbox.wav")
  
      left = MonoLoader(
          filename=filename, downmix="left", sampleRate=sampleRate
      )()
      right = MonoLoader(
          filename=filename, downmix="right", sampleRate=sampleRate
      )()
  
      frames_left = cutFrames(
          {
              "frameSize": framesize,
              "hopSize": hopsize,
              "startFromZero": False,
          },
          left,
      )
      frames_right = cutFrames(
          {
              "frameSize": framesize,
              "hopSize": hopsize,
              "startFromZero": False,
          },
          right,
      )
  
      spec = Spectrum()
      window = Windowing(
          size=framesize,
          zeroPadding=framesize * zeropadding,
          type="hann",
      )
      panning = Panning(
          averageFrames=21
      )  # matlab tests were generated with 21 (1second at 44100Hz)
      output = []
  
      for i in range(len(frames_left)):
          output = panning(
              spec(window(frames_left[i])),
              spec(window(frames_right[i])),
          )
  
          # readVector messes up with the last digits, so for small numbers
          # we get errors above 1e-7: Is there a way to set precision in
          # python?
          self.assertAlmostEqualVectorFixedPrecision(
              expected[i], output[0], 2
          )
  
file_path: essentia/test/src/unittests/standard/test_panning.py
imports: from essentia_test import *
  from math import log
label_desc: Use image node_id 1 for calling the TestPanning obj's underlying member method code with example usage: obj.testRegression() without return types