# scipy 1.18.1 (BSD-3-Clause), harvested by tools/harvest_corpus.py
=== input
Return a Gaussian window.

    Parameters
    ----------
    M : int
        Number of points in the output window. If zero, an empty array
        is returned. An exception is thrown when it is negative.
    std : float
        The standard deviation, sigma.
    sym : bool, optional
        When True (default), generates a symmetric window, for use in filter
        design.
        When False, generates a periodic window, for use in spectral analysis.
    %(xp_device_snippet)s

    Returns
    -------
    w : ndarray
        The window, with the maximum value normalized to 1 (though the value 1
        does not appear if `M` is even and `sym` is True).

    Notes
    -----
    The Gaussian window is defined as

    .. math::  w(n) = e^{ -\frac{1}{2}\left(\frac{n}{\sigma}\right)^2 }

    Examples
    --------
    Plot the window and its frequency response:

    >>> import numpy as np
    >>> from scipy import signal
    >>> from scipy.fft import fft, fftshift
    >>> import matplotlib.pyplot as plt

    >>> window = signal.windows.gaussian(51, std=7)
    >>> plt.plot(window)
    >>> plt.title(r"Gaussian window ($\sigma$=7)")
    >>> plt.ylabel("Amplitude")
    >>> plt.xlabel("Sample")

    >>> plt.figure()
    >>> A = fft(window, 2048) / (len(window)/2.0)
    >>> freq = np.linspace(-0.5, 0.5, len(A))
    >>> response = 20 * np.log10(np.abs(fftshift(A / abs(A).max())))
    >>> plt.plot(freq, response)
    >>> plt.axis([-0.5, 0.5, -120, 0])
    >>> plt.title(r"Frequency response of the Gaussian window ($\sigma$=7)")
    >>> plt.ylabel("Normalized magnitude [dB]")
    >>> plt.xlabel("Normalized frequency [cycles per sample]")

    
=== parse numpydoc
short_description: 'Return a Gaussian window.'
blank_after_short_description: True
blank_after_long_description: False
style: numpydoc
- DocstringParam
  description: |
    Number of points in the output window. If zero, an empty array
    is returned. An exception is thrown when it is negative.
  kind: param
  key: 'param'
  arg_name: 'M'
  type_name: 'int'
  is_optional: False
- DocstringParam
  description: 'The standard deviation, sigma.'
  kind: param
  key: 'param'
  arg_name: 'std'
  type_name: 'float'
  is_optional: False
- DocstringParam
  description: |
    When True (default), generates a symmetric window, for use in filter
    design.
    When False, generates a periodic window, for use in spectral analysis.
  kind: param
  key: 'param'
  arg_name: 'sym'
  type_name: 'bool'
  is_optional: True
  raw_type_name: 'bool, optional'
- DocstringParam
  kind: param
  key: 'param'
  arg_name: '%(xp_device_snippet)s'
  is_optional: False
- DocstringReturns
  description: |
    The window, with the maximum value normalized to 1 (though the value 1
    does not appear if `M` is even and `sym` is True).
  kind: returns
  key: 'returns'
  type_name: 'ndarray'
  is_generator: False
  return_name: 'w'
- DocstringMeta
  description: |
    The Gaussian window is defined as
    
    .. math::  w(n) = e^{ -\frac{1}{2}\left(\frac{n}{\sigma}\right)^2 }
  kind: text
  key: 'notes'
  title: 'Notes'
- DocstringExample
  description: 'Plot the window and its frequency response:'
  kind: examples
  key: 'examples'
  snippet: '>>> import numpy as np'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> from scipy import signal'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> from scipy.fft import fft, fftshift'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> import matplotlib.pyplot as plt'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> window = signal.windows.gaussian(51, std=7)'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> plt.plot(window)'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> plt.title(r"Gaussian window ($\\sigma$=7)")'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> plt.ylabel("Amplitude")'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> plt.xlabel("Sample")'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> plt.figure()'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> A = fft(window, 2048) / (len(window)/2.0)'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> freq = np.linspace(-0.5, 0.5, len(A))'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> response = 20 * np.log10(np.abs(fftshift(A / abs(A).max())))'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> plt.plot(freq, response)'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> plt.axis([-0.5, 0.5, -120, 0])'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> plt.title(r"Frequency response of the Gaussian window ($\\sigma$=7)")'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> plt.ylabel("Normalized magnitude [dB]")'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> plt.xlabel("Normalized frequency [cycles per sample]")'
=== detect
numpydoc
=== compose numpydoc
Return a Gaussian window.

Parameters
----------
M : int
    Number of points in the output window. If zero, an empty array
    is returned. An exception is thrown when it is negative.
std : float
    The standard deviation, sigma.
sym : bool, optional
    When True (default), generates a symmetric window, for use in filter
    design.
    When False, generates a periodic window, for use in spectral analysis.
%(xp_device_snippet)s

Returns
-------
w : ndarray
    The window, with the maximum value normalized to 1 (though the value 1
    does not appear if `M` is even and `sym` is True).

Notes
-----
The Gaussian window is defined as

.. math::  w(n) = e^{ -\frac{1}{2}\left(\frac{n}{\sigma}\right)^2 }

Examples
--------
Plot the window and its frequency response:

>>> import numpy as np
>>> from scipy import signal
>>> from scipy.fft import fft, fftshift
>>> import matplotlib.pyplot as plt
>>> window = signal.windows.gaussian(51, std=7)
>>> plt.plot(window)
>>> plt.title(r"Gaussian window ($\sigma$=7)")
>>> plt.ylabel("Amplitude")
>>> plt.xlabel("Sample")
>>> plt.figure()
>>> A = fft(window, 2048) / (len(window)/2.0)
>>> freq = np.linspace(-0.5, 0.5, len(A))
>>> response = 20 * np.log10(np.abs(fftshift(A / abs(A).max())))
>>> plt.plot(freq, response)
>>> plt.axis([-0.5, 0.5, -120, 0])
>>> plt.title(r"Frequency response of the Gaussian window ($\sigma$=7)")
>>> plt.ylabel("Normalized magnitude [dB]")
>>> plt.xlabel("Normalized frequency [cycles per sample]")
