docstr: Test automatically compensating for group delay of linear phase filter.
  
  Genearate filters to shift entire signal by a constant gain. Test that
  filtered signal is in phase with original signal.
  
  Args:
    gain: Amount to scale the input signal.
docstr_tok: ["Test","automatically","compensating","for","group","delay","of","linear","phase","filter",".","Genearate","filters","to","shift","entire","signal","by","a","constant","gain",".","Test","that","filtered","signal","is","in","phase","with","original","signal",".","Args",":","gain",":","Amount","to","scale","the","input","signal","."]
code: def test_delay_compensation_corrects_group_delay(self, gain):
      """Test automatically compensating for group delay of linear phase filter.
  
      Genearate filters to shift entire signal by a constant gain. Test that
      filtered signal is in phase with original signal.
  
      Args:
        gain: Amount to scale the input signal.
      """
      # Create random signal to filter.
      output_np = gain * self.audio[0]
      n_frequencies = 1025
      window_size = 257
  
      magnitudes = gain * tf.ones([1, n_frequencies], dtype=tf.float32)
      impulse_response = core.frequency_impulse_response(
          magnitudes, window_size
      )
      output_tf = core.fft_convolve(
          self.audio, impulse_response, padding="same"
      )[0]
  
      difference = output_np - output_tf
      total_difference = np.abs(difference).mean()
      threshold = 1e-3
      self.assertLessEqual(total_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 3 for calling the FiniteImpulseResponseTest obj's underlying member method code with example usage: obj.test_delay_compensation_corrects_group_delay(gain) without return types