Hann function
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 [math]\displaystyle{ L }[/math] and amplitude [math]\displaystyle{ 1/L, }[/math] is given by:
- [math]\displaystyle{ w_0(x) \triangleq \left\{ \begin{array}{ccl} \tfrac{1}{L}\left(\tfrac{1}{2} + \tfrac{1}{2} \cos \left(\frac{2\pi x}{L} \right) \right) = \tfrac{1}{L}\cos^2 \left(\frac{\pi x}{L}\right),\quad &\left|x\right| \leq L/2\\ 0,\quad &\left|x\right| \gt L/2 \end{array}\right\}. }[/math] [lower-alpha 1]
For digital signal processing, the function is sampled symmetrically (with spacing [math]\displaystyle{ L/N }[/math] and amplitude [math]\displaystyle{ 1 }[/math]):
- [math]\displaystyle{ \left . \begin{align} w[n] = L\cdot w_0\left(\tfrac{L}{N} (n-N/2)\right) &= \tfrac{1}{2} \left[1 - \cos \left ( \tfrac{2 \pi n}{N} \right) \right]\\ &= \sin^2 \left ( \tfrac{\pi n}{N} \right) \end{align} \right \},\quad 0 \leq n \leq N, }[/math]
which is a sequence of [math]\displaystyle{ N+1 }[/math] samples, and [math]\displaystyle{ N }[/math] can be even or odd. (see § Hann and Hamming windows) It is also known as the raised cosine window, Hann filter, von Hann window, etc.[2][3]
Fourier transform
The Fourier transform of [math]\displaystyle{ w_0(x) }[/math] is given by:
- [math]\displaystyle{ W_0(f) = \frac{1}{2}\frac{\operatorname{sinc}(Lf)}{(1 - L^2f^2)} = \frac{\sin(\pi Lf)}{2\pi L f(1 - L^2f^2)} }[/math] [lower-alpha 2]
Using Euler's formula to expand the cosine term in [math]\displaystyle{ w_0(x), }[/math] we can write:
- [math]\displaystyle{ w_0(x)= \tfrac{1}{L} \left(\tfrac{1}{2}\operatorname{rect}(x/L) +\tfrac{1}{4} e^{i 2\pi x/L} \operatorname{rect}(x/L) + \tfrac{1}{4}e^{-i 2\pi x/L} \operatorname{rect}(x/L)\right), }[/math]
which is a linear combination of modulated rectangular windows:
- [math]\displaystyle{ \tfrac{1}{L} \operatorname{rect}(x/L)\quad \stackrel{\text{Fourier transform}}{\longleftrightarrow}\quad \operatorname{sinc}(Lf) \triangleq \frac{\sin(\pi L f)}{\pi L f}. }[/math]
Transforming each term:
- [math]\displaystyle{ \begin{align} W_0(f) &= \tfrac{1}{2}\operatorname{sinc}(Lf) + \tfrac{1}{4} \operatorname{sinc}(L(f-1/L)) + \tfrac{1}{4} \operatorname{sinc}(L(f+1/L))\\ &= \tfrac{1}{2}\frac{\sin(\pi Lf)}{\pi Lf} + \tfrac{1}{4} \frac{\sin(\pi (Lf-1))}{\pi (Lf-1)} + \tfrac{1}{4} \frac{\sin(\pi (Lf+1))}{\pi (Lf+1)}\\ &= \frac{1}{2\pi}\left( \frac{\sin(\pi Lf)}{Lf} -\tfrac{1}{2} \frac{\sin(\pi Lf)}{Lf-1} -\tfrac{1}{2} \frac{\sin(\pi Lf)}{Lf+1}\right)\\ &= \frac{\sin(\pi Lf)}{2\pi}\left(\frac{1}{Lf} +\tfrac{1}{2} \frac{1}{1-Lf} -\tfrac{1}{2} \frac{1}{1+Lf}\right)\\ &= \frac{\sin(\pi Lf)}{2\pi}\cdot \frac{1}{Lf (1-Lf) (1+Lf)} = \frac{1}{2}\frac{\operatorname{sinc}(Lf)}{(1 - L^2f^2)}. \end{align} }[/math]
Discrete transforms
The Discrete-time Fourier transform (DTFT) of the [math]\displaystyle{ N+1 }[/math] 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:
- [math]\displaystyle{ \begin{align} \mathcal{F}\{w[n]\} &\triangleq \sum_{n=0}^{N} w[n]\cdot e^{-i 2 \pi f n}\\ &= e^{-i \pi f N}\left[\tfrac{1}{2} \frac{\sin(\pi(N+1)f)}{\sin(\pi f)} + \tfrac{1}{4} \frac{\sin(\pi(N+1)(f-\tfrac{1}{N}))}{\sin(\pi (f-\tfrac{1}{N}))} + \tfrac{1}{4} \frac{\sin(\pi(N+1)(f+\tfrac{1}{N}))}{\sin(\pi (f+\tfrac{1}{N}))}\right]. \end{align} }[/math]
The truncated sequence [math]\displaystyle{ \{w[n],\ 0 \le n \le N-1\} }[/math] 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:
- [math]\displaystyle{ \mathcal{F}\{w[n]\} = e^{-i \pi f (N-1)}\left[\tfrac{1}{2} \frac{\sin(\pi N f)}{\sin(\pi f)} + \tfrac{1}{4} e^{-i\pi/N} \frac{\sin(\pi N (f-\tfrac{1}{N}))}{\sin(\pi (f-\tfrac{1}{N}))} + \tfrac{1}{4} e^{i\pi/N} \frac{\sin(\pi N (f+\tfrac{1}{N}))}{\sin(\pi (f+\tfrac{1}{N}))}\right]. }[/math]
An N-length DFT of the window function samples the DTFT at frequencies [math]\displaystyle{ f = k/N, }[/math] for integer values of [math]\displaystyle{ k. }[/math] 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.[4][lower-alpha 3][lower-alpha 4]
Name
The function is named in honor of von Hann, who used the three-term weighted average smoothing technique on meteorological data.[5][2] However, the term Hanning function is also conventionally used,[6] derived from the paper in which the term hanning a signal was used to mean applying the Hann window to it.[7][8] The confusion arose from the similar Hamming function, named after Richard Hamming.
See also
Page citations
References
- ↑ Essenwanger, O. M. (Oskar M.) (1986). Elements of statistical analysis. Elsevier. ISBN 0444424261. OCLC 152410575.
- ↑ 2.0 2.1 Kahlig, Peter (1993), "Some aspects of Julius von Hann's contribution to modern climatology", in McBean, G.A.; Hantel, M. (in en), Interactions Between Global Climate Subsystems: The Legacy of Hann, Geophysical Monograph Series, 75, American Geophysical Union, pp. 1–7, doi:10.1029/gm075p0001, ISBN 9780875904665, https://www.researchgate.net/publication/260824978, retrieved 2019-07-01, "Hann appears to be the inventor of a certain data smoothing procedure, now called "hanning" ... or "Hann smoothing" ... Essentially, it is a three-term moving average (running mean) with unequal weights (1/4, 1/2, 1/4)."
- ↑ Smith, Julius O. (Julius Orion) (2011). Spectral audio signal processing. Stanford University. Center for Computer Research in Music and Acoustics., Stanford University. Department of Music.. [Stanford, Calif.?]: W3K. ISBN 9780974560731. OCLC 776892709. https://ccrma.stanford.edu/~jos/sasp/Hann_Hanning_Raised_Cosine.html.
- ↑ ; Collins,Terry & Hays,Peter et al."Wideband communication intercept and direction finding device using hyperchannelization" US patent 6898235, published 1999-12-10, issued 2005-05-24, also available at https://patentimages.storage.googleapis.com/4d/39/2a/cec2ae6f33c1e7/US6898235.pdf
- ↑ von Hann, Julius (1903) (in en). Handbook of Climatology. Macmillan. p. 199. https://archive.org/details/handbookclimato01wardgoog. "The figures under b are determined by taking into account the parallels 5° away on either side. Thus, for example, for latitude 60° we have ½[60 + (65 + 55)÷2]."
- ↑ Harris, Fredric J. (Jan 1978). "On the use of Windows for Harmonic Analysis with the Discrete Fourier Transform". Proceedings of the IEEE 66 (1): 51–83. doi:10.1109/PROC.1978.10837. http://web.mit.edu/xiphmont/Public/windows.pdf. "The correct name of this window is 'Hann.' The term 'Hanning' is used in this report to reflect conventional usage. The derived term 'Hann'd' is also widely used.".
- ↑ Blackman, R. B.; Tukey, J. W. (1958). "The measurement of power spectra from the point of view of communications engineering — Part I". The Bell System Technical Journal 37 (1): 273. doi:10.1002/j.1538-7305.1958.tb03874.x. ISSN 0005-8580.
- ↑ Blackman, R. B. (Ralph Beebe); Tukey, John W. (John Wilder) (1959). The measurement of power spectra from the point of view of communications engineering. New York : Dover Publications. pp. 98. https://archive.org/details/TheMeasurementOfPowerSpectra.
- Nuttall, Albert H. (Feb 1981). "Some Windows with Very Good Sidelobe Behavior". IEEE Transactions on Acoustics, Speech, and Signal Processing 29 (1): 84–91. doi:10.1109/TASSP.1981.1163506. https://zenodo.org/record/1280930.
External links
Original source: https://en.wikipedia.org/wiki/Hann function.
Read more |