docstr: Tests accuracy of wavetable synthesizer.
  
  Generate a sine wave wavetable synthesizer and compare to the analytic
  form. Error will vary with the size of the lookup table, but should stay
  below a threshold for moderate sized tables.
  
  Args:
    batch_size: Number of batch examples in the test phase signal.
    frequency: Frequency of the carrier signal in Hertz.
    amplitude: Amplitude of the carrier signal.
    n_wavetable: Number of samples in the wavetable.
    wavetable_frames: Number of wavetables over time.
docstr_tok: ["Tests","accuracy","of","wavetable","synthesizer",".","Generate","a","sine","wave","wavetable","synthesizer","and","compare","to","the","analytic","form",".","Error","will","vary","with","the","size","of","the","lookup","table",",","but","should","stay","below","a","threshold","for","moderate","sized","tables",".","Args",":","batch_size",":","Number","of","batch","examples","in","the","test","phase","signal",".","frequency",":","Frequency","of","the","carrier","signal","in","Hertz",".","amplitude",":","Amplitude","of","the","carrier","signal",".","n_wavetable",":","Number","of","samples","in","the","wavetable",".","wavetable_frames",":","Number","of","wavetables","over","time","."]
code: def test_wavetable_synth_is_accurate(
      self,
      batch_size,
      frequency,
      amplitude,
      n_wavetable,
      wavetable_frames,
  ):
      """Tests accuracy of wavetable synthesizer.
  
      Generate a sine wave wavetable synthesizer and compare to the analytic
      form. Error will vary with the size of the lookup table, but should stay
      below a threshold for moderate sized tables.
  
      Args:
        batch_size: Number of batch examples in the test phase signal.
        frequency: Frequency of the carrier signal in Hertz.
        amplitude: Amplitude of the carrier signal.
        n_wavetable: Number of samples in the wavetable.
        wavetable_frames: Number of wavetables over time.
      """
      sample_rate = 16000
      seconds = 0.1
      n_samples = int(sample_rate * seconds)
      n_cycles = seconds * frequency
      n_frames = 100
  
      two_pi = 2.0 * np.pi
      wavetable = np.sin(
          np.linspace(0, two_pi, n_wavetable).astype(np.float32)
      )
      wavetable = np.tile(wavetable[np.newaxis, :], [batch_size, 1])
      if wavetable_frames > 0:
          wavetable = np.tile(
              wavetable[:, np.newaxis, :], [1, wavetable_frames, 1]
          )
  
      wav_np = amplitude * np.sin(
          two_pi * np.linspace(0, n_cycles, n_samples)
      )
      wav_np = np.tile(wav_np[np.newaxis, :], [batch_size, 1]).astype(
          np.float32
      )
  
      amplitudes = np.ones([batch_size, n_frames, 1]) * amplitude
      frequencies = np.ones([batch_size, n_frames, 1]) * frequency
  
      wav_tf = core.wavetable_synthesis(
          frequencies, amplitudes, wavetable, n_samples, sample_rate
      )
  
      pad = n_samples // n_frames  # Ignore edge effects.
      difference = np.abs(
          wav_np[:, pad:-pad] - wav_tf[:, pad:-pad]
      ).mean()
      threshold = 3e-2
      self.assertLessEqual(difference, threshold)
  
imports: from absl.testing import parameterized
  from ddsp import core
  import librosa
  import numpy
  from scipy import signal
  import tensorflow.compat.v2
label_desc: Use image node_id 2 for calling the InterpolatingLookupTest obj's underlying member method code with example usage: obj.test_wavetable_synth_is_accurate(batch_size, frequency, amplitude, n_wavetable, wavetable_frames) without return types