docstr: Check subsampled high-resolution signal close to low-resolution signal.
  
  Args:
    smaller: Low resolution numpy array. Shape (size,).
    larger: High-resolution numpy array. Shape (size,).
    add_endpoint: Extra timestep has been added at end of resampling.
    threshold: Assertion threshold for all_close.
docstr_tok: ["Check","subsampled","high-resolution","signal","close","to","low-resolution","signal",".","Args",":","smaller",":","Low","resolution","numpy","array",".","Shape","(","size",",",")",".","larger",":","High-resolution","numpy","array",".","Shape","(","size",",",")",".","add_endpoint",":","Extra","timestep","has","been","added","at","end","of","resampling",".","threshold",":","Assertion","threshold","for","all_close","."]
code: def assert_subsampled_close(
      self, smaller, larger, add_endpoint, threshold=1e-3
  ):
      """Check subsampled high-resolution signal close to low-resolution signal.
  
      Args:
        smaller: Low resolution numpy array. Shape (size,).
        larger: High-resolution numpy array. Shape (size,).
        add_endpoint: Extra timestep has been added at end of resampling.
        threshold: Assertion threshold for all_close.
      """
      n_smaller = smaller.size
      n_larger = larger.size
      if add_endpoint:
          n_total = int(n_larger / n_smaller * (n_smaller - 1))
      else:
          n_total = n_larger - 1
      subsample_index = np.linspace(0, n_total, n_smaller).astype(int)
      larger_subsampled = larger[subsample_index]
      self.assertAllClose(larger_subsampled, smaller, atol=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 5 for calling the ResampleTest obj's underlying member method code with example usage: obj.assert_subsampled_close(smaller, larger, add_endpoint, threshold) without return types