NumPy has a number of window routines that can compute weights in a rolling window as we did in the previous section.

A **window function** is a function that is defined within an interval (the window) or is otherwise zero valued. We can use window functions for spectral analysis and filter design (for more background information, refer to http://en.wikipedia.org/wiki/Window_function). The **boxcar window** is a rectangular window with the following formula:

w(n) = 1

The **triangular window** is shaped like a triangle and has the following formula:

In the preceding formula, `L`

can be equal to `N`

, `N+1`

, or `N-1`

. In the last case, the window function ...

Start Free Trial

No credit card required