5.8.1 Window functions

A range of commonly-used window functions may automatically be applied to data as it is read into the fft and ifft commands; these are listed together with their algebraic forms in TableĀ 5.1 and shown in FigureĀ 5.1. In each case, the window functions are given for sample number $n$, which ranges between $0$ and $N_ x$. The window functions may be invoked using the following syntax:

fft [...] <out>() of <in>() window <window_name>

Where multi-dimensional FFTs are performed, window functions are applied to each dimension in turn. Other arbitrary window functions may be implemented by pre-multiplying data before entry to the fft and ifft commands.

Window Name

Algebraic Definition

Bartlett

$\displaystyle w(n) = \left( \frac{2}{N_ x-1} \right) \left( \frac{N_ x-1}{2} - \left| n - \frac{N_ x-1}{2} \right| \right)$ \rule{0pt}{20pt}

BartlettHann

$\displaystyle w(n) = a_0 - a_1\left|\frac{n}{N_ x-1}-\frac{1}{2}\right| - a_2\cos \left(\frac{2\pi n}{N_ x-1}\right),\; \textrm{for}$ \rule{0pt}{\wfgap }

 

$a_0=0.62,\;  a_1=0.48,\;  a_2=0.38.$ \rule{0pt}{20pt}

Cosine

$\displaystyle w(n) = \cos \left(\frac{\pi n}{N_ x-1} - \frac{\pi }{2} \right)$ \rule{0pt}{\wfgap }

Gauss

$\displaystyle w(n) = \exp \left\{  -\frac{1}{2}\left[ \frac{n-(N_ x-1)/2}{\sigma (N_ x-1)/2} \right]^2 \right\} ,\; \textrm{for}\; \sigma =0.5$ \rule{0pt}{\wfgap }

Hamming

$\displaystyle w(n) = 0.54 - 0.46\cos \left(\frac{2\pi n}{N_ x-1}\right)$ \rule{0pt}{\wfgap }

Hann

$\displaystyle w(n) = 0.5 \left[ 1 - \cos \left(\frac{2\pi n}{N_ x-1}\right) \right]$ \rule{0pt}{\wfgap }

Lanczos

$\displaystyle w(n) = \mathrm{sinc}\left( \frac{2n}{N_ x-1} - 1 \right)$ \rule{0pt}{\wfgap }

Rectangular

$\displaystyle w(n) = 1$ \rule{0pt}{\wfgap }

Triangular

$\displaystyle w(n) = \left( \frac{2}{N_ x} \right) \left( \frac{N_ x}{2} - \left| n - \frac{N_ x-1}{2} \right| \right)$ \rule{0pt}{\wfgap }

Table 5.1: Window functions available in the fft and ifft commands.
\includegraphics{examples/eps/ex_windowfuncs}
Figure 5.1: Window functions available in the fft and ifft commands.