Hann function

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
Hann function (left), and its frequency response (right)

The Hann function is named after the Austrian meteorologist Julius von Hann. It is a window function used to perform Hann smoothing or hanning.[1][2] The function, with length L and amplitude 1/L, is given by:

w0(x){1L(12+12cos(2πxL))=1Lcos2(πxL),|x|L/20,|x|>L/2}.   [a]

For digital signal processing, the function is sampled symmetrically (with spacing L/N and amplitude 1):

w[n]=Lw0(LN(nN/2))=12[1cos(2πnN)]=sin2(πnN)},0nN,

which is a sequence of N+1 samples, and N can be even or odd. It is also known as the raised cosine window, Hann filter, von Hann window, Hanning window, etc.[2][3][4]

Fourier transform

[edit | edit source]
Top: 16 sample DFT-even Hann window. Bottom: Its discrete-time Fourier transform (DTFT) and the 3 non-zero values of its discrete Fourier transform (DFT).

The Fourier transform of w0(x) is given by:

W0(f)=12sinc(Lf)(1L2f2)=sin(πLf)2πLf(1L2f2)   [b]
Derivation

Using Euler's formula to expand the cosine term in w0(x), we can write:

w0(x)=1L(12rect(x/L)+14ei2πx/Lrect(x/L)+14ei2πx/Lrect(x/L)),

which is a linear combination of modulated rectangular windows:

1Lrect(x/L)Fourier transformsinc(Lf)sin(πLf)πLf.

Transforming each term:

W0(f)=12sinc(Lf)+14sinc(L(f1/L))+14sinc(L(f+1/L))=12sin(πLf)πLf+14sin(π(Lf1))π(Lf1)+14sin(π(Lf+1))π(Lf+1)=12π(sin(πLf)Lf12sin(πLf)Lf112sin(πLf)Lf+1)=sin(πLf)2π(1Lf+1211Lf1211+Lf)=sin(πLf)2π1Lf(1Lf)(1+Lf)=12sinc(Lf)(1L2f2).

Discrete transforms

[edit | edit source]

The discrete-time Fourier transform (DTFT) of the N+1 length, time-shifted sequence is defined by a Fourier series, which also has a 3-term equivalent that is derived similarly to the Fourier transform derivation:

{w[n]}n=0Nw[n]ei2πfn=eiπfN[12sin(π(N+1)f)sin(πf)+14sin(π(N+1)(f1N))sin(π(f1N))+14sin(π(N+1)(f+1N))sin(π(f+1N))].

The truncated sequence {w[n], 0nN1} is a DFT-even (aka periodic) Hann window. Since the truncated sample has value zero, it is clear from the Fourier series definition that the DTFTs are equivalent. However, the approach followed above results in a significantly different-looking, but equivalent, 3-term expression:

{w[n]}=eiπf(N1)[12sin(πNf)sin(πf)+14eiπ/Nsin(πN(f1N))sin(π(f1N))+14eiπ/Nsin(πN(f+1N))sin(π(f+1N))].

An N-length DFT of the window function samples the DTFT at frequencies f=k/N, for integer values of k. From the expression immediately above, it is easy to see that only 3 of the N DFT coefficients are non-zero. And from the other expression, it is apparent that all are real-valued. These properties are appealing for real-time applications that require both windowed and non-windowed (rectangularly windowed) transforms, because the windowed transforms can be efficiently derived from the non-windowed transforms by convolution.[5][c][d]

The function is named in honor of von Hann, who used the three-term weighted average smoothing technique on meteorological data.[6][2] However, the term Hanning function is also conventionally used,[7] derived from the paper in which the term hanning a signal was used to mean applying the Hann window to it.[4][8] It is distinct from the similarly-named Hamming function, named after Richard Hamming.

See also

[edit | edit source]

Page citations

[edit | edit source]
  1. ^ Nuttall 1981, p 84 (3)
  2. ^ Nuttall 1981, p 86 (17)
  3. ^ Nuttall 1981, p 85
  4. ^ Harris 1978, p 62

References

[edit | edit source]
  1. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  2. ^ a b c Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  3. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  4. ^ a b Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  5. ^ US patent 6898235, Carlin, Joe; Collins, Terry & Hays, Peter et al., "Wideband communication intercept and direction finding device using hyperchannelization", published Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value)., issued Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value). , also available at https://patentimages.storage.googleapis.com/4d/39/2a/cec2ae6f33c1e7/US6898235.pdf
  6. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  7. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  8. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  1. Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
[edit | edit source]