docstr: Tests accuracy of linear interpolation lookup.
  
  Generate a sine wave from linear table lookup 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.
    n_wavetable: Number of samples in the wavetable.
    n_frames: Number of frames in the wavetable.
    n_samples: Number of samples in the test phase signal.
    n_cycles: Number of cycles in the test phase signal.
docstr_tok: ["Tests","accuracy","of","linear","interpolation","lookup",".","Generate","a","sine","wave","from","linear","table","lookup","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",".","n_wavetable",":","Number","of","samples","in","the","wavetable",".","n_frames",":","Number","of","frames","in","the","wavetable",".","n_samples",":","Number","of","samples","in","the","test","phase","signal",".","n_cycles",":","Number","of","cycles","in","the","test","phase","signal","."]
code: def test_linear_lookup_is_accurate(
      self, batch_size, n_wavetable, n_frames, n_samples, n_cycles
  ):
      """Tests accuracy of linear interpolation lookup.
  
      Generate a sine wave from linear table lookup 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.
        n_wavetable: Number of samples in the wavetable.
        n_frames: Number of frames in the wavetable.
        n_samples: Number of samples in the test phase signal.
        n_cycles: Number of cycles in the test phase signal.
      """
      threshold = 2e-3
      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 n_frames > 0:
          wavetable = np.tile(
              wavetable[:, np.newaxis, :], [1, n_frames, 1]
          )
  
      phase = (
          np.linspace(0, n_cycles, n_samples).astype(np.float32) % 1.0
      )
      phase = np.tile(
          phase[np.newaxis, :, np.newaxis], [batch_size, 1, 1]
      )
      wav_np = np.sin(two_pi * phase)[:, :, 0]
  
      wav_tf = core.linear_lookup(phase, wavetable)
  
      difference = np.abs(wav_np - wav_tf).mean()
      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 1 for calling the InterpolatingLookupTest obj's underlying member method code with example usage: obj.test_linear_lookup_is_accurate(batch_size, n_wavetable, n_frames, n_samples, n_cycles) without return types