code: def random_harm_dist(n_harmonics=100, low_pass=True, rand_phase=0.0):
      """Create harmonic distribution out of sinusoidal components."""
      n_components = uniform_int(1, 20)
      smoothness = uniform_float(1.0, 10.0)
      coeffs = np.random.rand(n_components)
      freqs = np.random.rand(n_components) * n_harmonics / smoothness
  
      v = []
      for i in range(n_components):
          v_i = coeffs[i] * np.cos(
              np.linspace(0.0, 2.0 * np.pi * freqs[i], n_harmonics)
              + uniform_float(0.0, np.pi * 2.0 * rand_phase)
          )
          v.append(v_i)
  
      if low_pass:
          v = [
              v_i
              * np.linspace(1.0, uniform_float(0.0, 0.5), n_harmonics)
              ** uniform_float(0.5, 2.0)
              for v_i in v
          ]
      harm_dist = np.sum(np.stack(v), axis=0)
      return harm_dist
  
file_path: ddsp/ddsp/training/data_preparation/synthetic_data.py
imports: import warnings
  import ddsp
  import gin
  import numpy
  import tensorflow.compat.v2
label_desc: Use image node_id 9 for calling a global function with example usage: random_harm_dist(n_harmonics, low_pass, rand_phase) and returns: harm_dist