docstr: Test that downsampling is accurate for different methods.
  
  Generates a signal and downsamples it to different resolution.
  Compares the downsampled signal and original signal at corresponding
  subsampled points. Don't test for `window` method because downsampling is
  not allowed.
  
  Args:
    add_endpoint: Add extra timestep at end of resampling.
    method: Method of resampling.
docstr_tok: ["Test","that","downsampling","is","accurate","for","different","methods",".","Generates","a","signal","and","downsamples","it","to","different","resolution",".","Compares","the","downsampled","signal","and","original","signal","at","corresponding","subsampled","points",".","Do","n't","test","for","`","window","`","method","because","downsampling","is","not","allowed",".","Args",":","add_endpoint",":","Add","extra","timestep","at","end","of","resampling",".","method",":","Method","of","resampling","."]
code: def test_downsample_accuracy(self, add_endpoint, method):
      """Test that downsampling is accurate for different methods.
  
      Generates a signal and downsamples it to different resolution.
      Compares the downsampled signal and original signal at corresponding
      subsampled points. Don't test for `window` method because downsampling is
      not allowed.
  
      Args:
        add_endpoint: Add extra timestep at end of resampling.
        method: Method of resampling.
      """
      before, after = self.create_resampled_signals(
          n_before=self.n_larger,
          n_after=self.n_smaller,
          add_endpoint=add_endpoint,
          method=method,
      )
      self.assert_subsampled_close(
          smaller=after, larger=before, add_endpoint=add_endpoint
      )
  
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 7 for calling the ResampleTest obj's underlying member method code with example usage: obj.test_downsample_accuracy(add_endpoint, method) without return types