class_docstr: Different author, different style, different tests...
class_docstr_tok: ["Different","author",",","different","style",",","different","tests","..."]
docstr: Test the fs and nyq keywords.
docstr_tok: ["Test","the","fs","and","nyq","keywords","."]
code: def test_fs_nyq(self):
      """Test the fs and nyq keywords."""
      nyquist = 1000
      width = 40.0
      relative_width = width / nyquist
      ntaps, beta = kaiserord(120, relative_width)
      taps = firwin(
          ntaps,
          cutoff=[300, 700],
          window=("kaiser", beta),
          pass_zero=False,
          scale=False,
          fs=2 * nyquist,
      )
  
      # Check the symmetry of taps.
      assert_array_almost_equal(
          taps[: ntaps // 2], taps[ntaps : ntaps - ntaps // 2 - 1 : -1]
      )
  
      # Check the gain at a few samples where we know it should be approximately 0 or 1.
      freq_samples = np.array(
          [
              0.0,
              200,
              300 - width / 2,
              300 + width / 2,
              500,
              700 - width / 2,
              700 + width / 2,
              800,
              1000,
          ]
      )
      freqs, response = freqz(taps, worN=np.pi * freq_samples / nyquist)
      assert_array_almost_equal(
          np.abs(response),
          [0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0],
          decimal=5,
      )
  
      taps2 = firwin(
          ntaps,
          cutoff=[300, 700],
          window=("kaiser", beta),
          pass_zero=False,
          scale=False,
          nyq=nyquist,
      )
      assert_allclose(taps2, taps)
  
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 5 for calling the TestFirWinMore obj's underlying member method code with example usage: obj.test_fs_nyq() without return types