code: def test_one_single_input(
      self, center_frequency, bandwidth_fraction, rolloff, zero_phase
  ):
      sample_rate = 16000
  
      # Parameters for computing periodograms.
      # When examining lower frequencies we need to have
      # a high nfft number.
  
      nfft = 2048 * 2
      nperseg = 128
  
      samples = get_chirp_test(sample_rate, 10)
  
      # Expected dB drop at fc
      if zero_phase:
          expected_db_drop = 6
      else:
          expected_db_drop = 3
  
      if zero_phase and rolloff % 12 != 0:
          with pytest.raises(AssertionError):
              augment = BandPassFilter(
                  min_center_freq=center_frequency,
                  max_center_freq=center_frequency,
                  min_bandwidth_fraction=bandwidth_fraction,
                  max_bandwidth_fraction=bandwidth_fraction,
                  min_rolloff=rolloff,
                  max_rolloff=rolloff,
                  zero_phase=zero_phase,
                  p=1.0,
              )
          return
      else:
          augment = BandPassFilter(
              min_center_freq=center_frequency,
              max_center_freq=center_frequency,
              min_bandwidth_fraction=bandwidth_fraction,
              max_bandwidth_fraction=bandwidth_fraction,
              min_rolloff=rolloff,
              max_rolloff=rolloff,
              zero_phase=zero_phase,
              p=1.0,
          )
  
      processed_samples = augment(
          samples=samples, sample_rate=sample_rate
      )
  
      # Compute periodograms
      wx, samples_pxx = scipy.signal.welch(
          samples,
          fs=sample_rate,
          nfft=nfft,
          nperseg=nperseg,
          scaling="spectrum",
          window="hann",
      )
      _, processed_samples_pxx = scipy.signal.welch(
          processed_samples,
          fs=sample_rate,
          nperseg=nperseg,
          nfft=nfft,
          scaling="spectrum",
          window="hann",
      )
  
      if DEBUG:
          import matplotlib.pyplot as plt
  
          plt.title(
              f"Filter type: Band-pass Roll-off:{rolloff}dB/octave Zero-phase:{zero_phase}"
          )
          plt.plot(wx, 10 * np.log10(np.abs(samples_pxx)))
          plt.plot(
              wx, 10 * np.log10(np.abs(processed_samples_pxx)), ":"
          )
          plt.legend(
              [
                  "Input signal",
                  f"Highpassed at f_c={center_frequency:.2f}",
              ]
          )
          plt.axvline(center_frequency, color="red", linestyle=":")
          plt.xlabel("Frequency (Hz)")
          plt.ylabel("Magnitude (dB)")
          plt.show()
  
      assert processed_samples.shape == samples.shape
      assert processed_samples.dtype == np.float32
  
      bandwidth = bandwidth_fraction * center_frequency
      left_cutoff_freq = center_frequency - bandwidth / 2
      right_cutoff_freq = center_frequency + bandwidth / 2
  
      frequencies_of_interest = np.array(
          [
              left_cutoff_freq,
              center_frequency,
              right_cutoff_freq,
          ]
      )
      expected_differences = np.array(
          [
              expected_db_drop,
              0,
              expected_db_drop,
          ]
      )
  
      # Tolerances for the differences in dB
      tolerances = np.array([2.0, 1.0, 2.0])
  
      for n, freq in enumerate(frequencies_of_interest):
          input_value_db = 10 * np.log10(
              samples_pxx[int(np.round(nfft / sample_rate * freq))]
          )
  
          output_value_db = 10 * np.log10(
              processed_samples_pxx[
                  int(np.round(nfft / sample_rate * freq))
              ]
          )
  
          assert np.isclose(
              input_value_db - output_value_db,
              expected_differences[n],
              atol=tolerances[n],
          )
  
imports: import numpy
  import pytest
  import scipy
  import scipy.signal
  from audiomentations import BandPassFilter, BandStopFilter, HighPassFilter, LowPassFilter, PeakingFilter, LowShelfFilter, HighShelfFilter
label_desc: Use image node_id 1 for calling the TestBandPassFilterTransform obj's underlying member method code with example usage: obj.test_one_single_input(center_frequency, bandwidth_fraction, rolloff, zero_phase) without return types