The Hann function is named after the Austrian meteorologist Julius von Hann. It is a window function used to perform Hann smoothing. The function, with length
L
1/L,
w0(x)\triangleq\left\{ \begin{array}{ccl} \tfrac{1}{L}\left(\tfrac{1}{2}+\tfrac{1}{2}\cos\left(
2\pix | |
L |
\right)\right)=\tfrac{1}{L}\cos2\left(
\pix | |
L |
\right), &\left|x\right|\leqL/2\\ 0, &\left|x\right|>L/2 \end{array}\right\}.
For digital signal processing, the function is sampled symmetrically (with spacing
L/N
1
\left.\begin{align} w[n]=L ⋅ w0\left(\tfrac{L}{N}(n-N/2)\right)&=\tfrac{1}{2}\left[1-\cos\left(\tfrac{2\pin}{N}\right)\right]\\ &=\sin2\left(\tfrac{\pin}{N}\right) \end{align} \right\}, 0\leqn\leqN,
which is a sequence of
N+1
N
The Fourier transform of
w0(x)
W0(f)=
1 | |
2 |
\operatorname{sinc | |
(Lf)}{(1 |
-L2f2)}=
\sin(\piLf) | |
2\piLf(1-L2f2) |
The Discrete-time Fourier transform (DTFT) of the
N+1
\begin{align} l{F}\{w[n]\}&\triangleq
N | |
\sum | |
n=0 |
w[n] ⋅ e-i\\ &=e-i\left[\tfrac{1}{2}
\sin(\pi(N+1)f) | |
\sin(\pif) |
+\tfrac{1}{4}
\sin(\pi(N+1)(f-\tfrac{1 | |
N |
))}{\sin(\pi(f-\tfrac{1}{N}))}+\tfrac{1}{4}
\sin(\pi(N+1)(f+\tfrac{1 | |
N |
))}{\sin(\pi(f+\tfrac{1}{N}))}\right]. \end{align}
The truncated sequence
\{w[n], 0\len\leN-1\}
l{F}\{w[n]\}=e-i\left[\tfrac{1}{2}
\sin(\piNf) | |
\sin(\pif) |
+\tfrac{1}{4}e-i\pi/N
\sin(\piN(f-\tfrac{1 | |
N |
))}{\sin(\pi(f-\tfrac{1}{N}))}+\tfrac{1}{4}ei\pi/N
\sin(\piN(f+\tfrac{1 | |
N |
))}{\sin(\pi(f+\tfrac{1}{N}))}\right].
An N-length DFT of the window function samples the DTFT at frequencies
f=k/N,
k.
The function is named in honor of von Hann, who used the three-term weighted average smoothing technique on meteorological data. However, the term Hanning function is also conventionally used, derived from the paper in which the term hanning a signal was used to mean applying the Hann window to it. The confusion arose from the similar Hamming function, named after Richard Hamming.