code: def test_compare(self):
      # compare to OCTAVE output
      taps = firls(9, [0, 0.5, 0.55, 1], [1, 1, 0, 0], weight=[1, 2])
      # >> taps = firls(8, [0 0.5 0.55 1], [1 1 0 0], [1, 2]);
      known_taps = [
          -6.26930101730182e-04,
          -1.03354450635036e-01,
          -9.81576747564301e-03,
          3.17271686090449e-01,
          5.11409425599933e-01,
          3.17271686090449e-01,
          -9.81576747564301e-03,
          -1.03354450635036e-01,
          -6.26930101730182e-04,
      ]
      assert_allclose(taps, known_taps)
  
      # compare to MATLAB output
      taps = firls(11, [0, 0.5, 0.5, 1], [1, 1, 0, 0], weight=[1, 2])
      # >> taps = firls(10, [0 0.5 0.5 1], [1 1 0 0], [1, 2]);
      known_taps = [
          0.058545300496815,
          -0.014233383714318,
          -0.104688258464392,
          0.012403323025279,
          0.317930861136062,
          0.488047220029700,
          0.317930861136062,
          0.012403323025279,
          -0.104688258464392,
          -0.014233383714318,
          0.058545300496815,
      ]
      assert_allclose(taps, known_taps)
  
      # With linear changes:
      taps = firls(7, (0, 1, 2, 3, 4, 5), [1, 0, 0, 1, 1, 0], fs=20)
      # >> taps = firls(6, [0, 0.1, 0.2, 0.3, 0.4, 0.5], [1, 0, 0, 1, 1, 0])
      known_taps = [
          1.156090832768218,
          -4.1385894727395849,
          7.5288619164321826,
          -8.5530572592947856,
          7.5288619164321826,
          -4.1385894727395849,
          1.156090832768218,
      ]
      assert_allclose(taps, known_taps)
  
      with np.testing.suppress_warnings() as sup:
          sup.filter(DeprecationWarning, "Keyword argument 'nyq'")
          taps = firls(
              7, (0, 1, 2, 3, 4, 5), [1, 0, 0, 1, 1, 0], nyq=10
          )
          assert_allclose(taps, known_taps)
  
          with pytest.raises(ValueError, match="between 0 and 1"):
              firls(7, [0, 1], [0, 1], nyq=0.5)
  
imports: import numpy
  from numpy.testing import assert_almost_equal, assert_array_almost_equal, assert_equal, assert_, assert_allclose, assert_warns
  from pytest import raises
  import pytest
  from scipy.fft import fft
  from scipy.special import sinc
  from scipy.signal import kaiser_beta, kaiser_atten, kaiserord, firwin, firwin2, freqz, remez, firls, minimum_phase
label_desc: Use image node_id 3 for calling the TestFirls obj's underlying member method code with example usage: obj.test_compare() without return types