, sym=True)[source]#

Return a Lanczos window also known as a sinc window.

  • M (int) – Number of points in the output window. If zero, an empty array is returned. An exception is thrown when it is negative.

  • 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.


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

Return type:



The Lanczos window is defined as

\[w(n) = sinc \left( \frac{2n}{M - 1} - 1 \right)\]


\[sinc(x) = \frac{\sin(\pi x)}{\pi x}\]

The Lanczos window has reduced Gibbs oscillations and is widely used for filtering climate timeseries with good properties in the physical and spectral domains.