docstr: Perform tests on melspectrum as calculated for test waveform.
docstr_tok: ["Perform","tests","on","melspectrum","as","calculated","for","test","waveform","."]
code: def VerifyMelSpectrumPatch(self, features):
      """Perform tests on melspectrum as calculated for test waveform."""
      expected_time_steps = 96
      expected_mel_bands = 64
      self.assertEqual(
          (expected_time_steps, expected_mel_bands), features.shape
      )
      # Expect peak magnitude to be somewhere near expected_time_steps/2 == 48
      # (due to raised cosine envelope.)  It isn't *exactly* in the middle because
      # the interaction between the sweeping tone and the mel bands causes some
      # ripple atop the columnwise max.  The peok is actually at frame 43.
      peak_frame = np.argmax(np.max(features, axis=1))
      self.assertGreater(peak_frame, 40)
      self.assertLess(peak_frame, 56)
      # Expect peak frequencies to move up with sweep.  These are "golden",
      # but agree with predictions from instantaneous frequencies and mel scale.
      self.assertEqual(np.argmax(features[20]), 11)
      self.assertEqual(np.argmax(features[42]), 15)
      self.assertEqual(np.argmax(features[64]), 20)
  
imports: import tempfile
  from magenta.models.onsets_frames_transcription import melspec_input
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling the MelspecInputTest obj's underlying member method code with example usage: obj.VerifyMelSpectrumPatch(features) without return types