class_docstr: Dynamically compute additional power_db feature.
class_docstr_tok: ["Dynamically","compute","additional","power_db","feature","."]
docstr: Compute power on the fly if it's not in the inputs.
docstr_tok: ["Compute","power","on","the","fly","if","it","'s","not","in","the","inputs","."]
code: def call(
      self, f0_hz, power_db=None, audio=None
  ) -> ["f0_hz", "pw_db", "f0_scaled", "pw_scaled"]:
      """Compute power on the fly if it's not in the inputs."""
      # For NN training, scale frequency and loudness to the range [0, 1].
      f0_hz = self.resample(f0_hz)
      f0_scaled = scale_f0_hz(f0_hz)
  
      if power_db is not None:
          # Use dataset values if present.
          pw_db = power_db
      elif audio is not None:
          # Otherwise, compute power on the fly.
          pw_db = ddsp.spectral_ops.compute_power(
              audio,
              sample_rate=self.sample_rate,
              frame_rate=self.frame_rate,
              frame_size=self.frame_size,
          )
      else:
          raise ValueError(
              "Power preprocessing requires either "
              '"power_db" or "audio" keys to be provided '
              "in the dataset."
          )
      # Resample.
      pw_db = self.resample(pw_db)
      # Scale power.
      pw_scaled = scale_db(pw_db)
  
      return f0_hz, pw_db, f0_scaled, pw_scaled
  
imports: import ddsp
  from ddsp.training import nn
  import gin
  import tensorflow
label_desc: Use image node_id 2 for calling the F0PowerPreprocessor obj's underlying member method code with example usage: obj.call(f0_hz, power_db, audio) and returns: f0_hz,  pw_db,  f0_scaled,  pw_scaled