Repository: scipy/scipy
File: scipy/signal/_fir_filter_design.py (Python)

Code before:
    ValueError exception is raised if firwin is called with `numtaps` even and
    having a passband whose right end is at the Nyquist frequency.

    Parameters
    ----------
    numtaps : int
        Length of the filter (number of coefficients, i.e. the filter
        order + 1).  `numtaps` must be odd if a passband includes the
        Nyquist frequency.
    cutoff : float or 1-D array_like
        Cutoff frequency of filter (expressed in the same units as `fs`)
        OR an array of cutoff frequencies (that is, band edges). In the 
        former case, as a float, the cutoff frequency should correspond 
        with the half-amplitude point, where the attenuation will be -6dB. 
        In the latter case, the frequencies in `cutoff` should be positive 
        and monotonically increasing between 0 and `fs/2`. The values 0 
        and `fs/2` must not be included in `cutoff`. It should be noted 
        that this is different than the behavior of `scipy.signal.iirdesign`, 
        where the cutoff is the half-power point (-3dB).
    width : float or None, optional
        If `width` is not None, then assume it is the approximate width
        of the transition region (expressed in the same units as `fs`)
        for use in Kaiser FIR filter design. In this case, the `window`
        argument is ignored.
    window : string or tuple of string and parameter values, optional
        Desired window to use. See `scipy.signal.get_window` for a list
        of windows and required parameters.
    pass_zero : {True, False, 'bandpass', 'lowpass', 'highpass', 'bandstop'}, optional
        If True, the gain at the frequency 0 (i.e., the "DC gain") is 1.
        If False, the DC gain is 0. Can also be a string argument for the
        desired filter type (equivalent to ``btype`` in IIR design functions).

        .. versionadded:: 1.3.0
           Support for string arguments.
    scale : bool, optional
        Set to True to scale the coefficients so that the frequency
        response is exactly unity at a certain frequency.
        That frequency is either:

        - 0 (DC) if the first passband starts at 0 (i.e. pass_zero
          is True)
        - `fs/2` (the Nyquist frequency) if the first passband ends at
          `fs/2` (i.e the filter is a single band highpass filter);
          center of first passband otherwise

    fs : float, optional
        The sampling frequency of the signal. Each frequency in `cutoff`
        must be between 0 and ``fs/2``.  Default is 2.

    Returns
    -------

Review comment (bug):
Okay so if I'm reading this right... `get_window("hamming")` is the same as `get_window("hamming_symmetric")`?

Elsewhere you have now changed the default from `"hamm"` to `"hamm_periodic"`. This means that users will obtain different results using `csd`, `welch`, etc. This is a bugfix, right? If so, do you think it's important enough to list in the [notes](https://github.com/scipy/scipy/blob/main/doc/source/release/1.17.0-notes.rst) since it could change results of quite old functions (welch at least) for people unexpectedly?

Code after:
    ValueError exception is raised if firwin is called with `numtaps` even and
    having a passband whose right end is at the Nyquist frequency.

    Parameters
    ----------
    numtaps : int
        Length of the filter (number of coefficients, i.e. the filter
        order + 1).  `numtaps` must be odd if a passband includes the
        Nyquist frequency.
    cutoff : float or 1-D array_like
        Cutoff frequency of filter (expressed in the same units as `fs`)
        OR an array of cutoff frequencies (that is, band edges). In the
        former case, as a float, the cutoff frequency should correspond
        with the half-amplitude point, where the attenuation will be -6dB.
        In the latter case, the frequencies in `cutoff` should be positive
        and monotonically increasing between 0 and `fs/2`. The values 0
        and `fs/2` must not be included in `cutoff`. It should be noted
        that this is different from the behavior of `scipy.signal.iirdesign`,
        where the cutoff is the half-power point (-3dB).
    width : float or None, optional
        If `width` is not None, then assume it is the approximate width
        of the transition region (expressed in the same units as `fs`)
        for use in Kaiser FIR filter design. In this case, the `window`
        argument is ignored.
    window : string or tuple of string and parameter values, optional
        Desired window to use. Default is ``'hamming'``. The window will be symmetric,
        unless a suffix ``'_periodic'`` is appended to the window name (e.g.,
        ``'hamming_perodic'``) Consult `~scipy.signal.get_window` for a list of windows
        and required parameters.
    pass_zero : {True, False, 'bandpass', 'lowpass', 'highpass', 'bandstop'}, optional
        If True, the gain at the frequency 0 (i.e., the "DC gain") is 1.
        If False, the DC gain is 0. Can also be a string argument for the
        desired filter type (equivalent to ``btype`` in IIR design functions).

        .. versionadded:: 1.3.0
           Support for string arguments.
    scale : bool, optional
        Set to True to scale the coefficients so that the frequency
        response is exactly unity at a certain frequency.
        That frequency is either:

        - 0 (DC) if the first passband starts at 0 (i.e. pass_zero
          is True)
        - `fs/2` (the Nyquist frequency) if the first passband ends at
          `fs/2` (i.e the filter is a single band highpass filter);
          center of first passband otherwise

    fs : float, optional
        The sampling frequency of the signal. Each frequency in `cutoff`
        must be between 0 and ``fs/2``.  Default is 2.