Hann function

From testwiki
Revision as of 11:43, 28 January 2025 by imported>Jumbo T (Name: ce)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:Short description Template:Distinguish

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.[1] 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}.   Template:Efn-la

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

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)   Template:Efn-la

Template:Math proof

Discrete transforms

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]Template:Efn-laTemplate:Efn-la

Name

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

Page citations

Template:Notelist-la

References

Template:Reflist

Template:Refbegin

  1. Template:Cite journal

Template:Refend

  1. Cite error: Invalid <ref> tag; no text was provided for refs named Essenwanger
  2. 2.0 2.1 Cite error: Invalid <ref> tag; no text was provided for refs named Kahlig
  3. Cite error: Invalid <ref> tag; no text was provided for refs named Smith
  4. 4.0 4.1 Cite error: Invalid <ref> tag; no text was provided for refs named Blackman
  5. Cite error: Invalid <ref> tag; no text was provided for refs named Carlin
  6. Cite error: Invalid <ref> tag; no text was provided for refs named Hann
  7. Cite error: Invalid <ref> tag; no text was provided for refs named Harris
  8. Cite error: Invalid <ref> tag; no text was provided for refs named Blackman2