docstr: Tests generating a harmonic waveform with varying number of harmonics.
  
  Generates waveforms with tensorflow and numpy and tests that they are
  the same. Test over a range of inputs provided by the parameterized
  inputs.
  
  Args:
    n_harmonics: Number of harmonics to synthesize.
docstr_tok: ["Tests","generating","a","harmonic","waveform","with","varying","number","of","harmonics",".","Generates","waveforms","with","tensorflow","and","numpy","and","tests","that","they","are","the","same",".","Test","over","a","range","of","inputs","provided","by","the","parameterized","inputs",".","Args",":","n_harmonics",":","Number","of","harmonics","to","synthesize","."]
code: def test_harmonic_synthesis_is_accurate_multiple_harmonics(
      self, n_harmonics
  ):
      """Tests generating a harmonic waveform with varying number of harmonics.
  
      Generates waveforms with tensorflow and numpy and tests that they are
      the same. Test over a range of inputs provided by the parameterized
      inputs.
  
      Args:
        n_harmonics: Number of harmonics to synthesize.
      """
      fundamental_frequency = 440.0
      amp = 0.1
      n_frames = 100
  
      harmonic_shifts = np.abs(np.random.randn(1, 1, n_harmonics))
      harmonic_distribution = np.abs(np.random.randn(1, 1, n_harmonics))
  
      frequencies_tf = fundamental_frequency * np.ones(
          [self.batch_size, n_frames, 1]
      )
      amplitudes_tf = amp * np.ones([self.batch_size, n_frames, 1])
      harmonic_shifts_tf = np.tile(harmonic_shifts, [1, n_frames, 1])
      harmonic_distribution_tf = np.tile(
          harmonic_distribution, [1, n_frames, 1]
      )
  
      # Create np test signal.
      frequencies_np = fundamental_frequency * np.ones(
          [self.batch_size, self.n_samples, 1]
      )
      amplitudes_np = amp * np.ones(
          [self.batch_size, self.n_samples, 1]
      )
      frequencies_np = frequencies_np * harmonic_shifts
      amplitudes_np = amplitudes_np * harmonic_distribution
      wav_np = create_wave_np(
          self.batch_size,
          frequencies_np,
          amplitudes_np,
          self.seconds,
          self.n_samples,
      )
  
      wav_tf = core.harmonic_synthesis(
          frequencies_tf,
          amplitudes_tf,
          harmonic_shifts_tf,
          harmonic_distribution_tf,
          n_samples=self.n_samples,
          sample_rate=self.sample_rate,
      )
      pad = self.n_samples // n_frames  # Ignore edge effects.
      self.assertAllClose(wav_np[pad:-pad], wav_tf[pad:-pad])
  
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 6 for calling the HarmonicSynthTest obj's underlying member method code with example usage: obj.test_harmonic_synthesis_is_accurate_multiple_harmonics(n_harmonics) without return types