The window, with the maximum value normalized to one (the value
one appears only if M is odd).
Notes
The Hanning window is defined as
w(n)=0.5−0.5cos(M−12πn)0≤n≤M−1 The Hanning was named for Julius von Hann, an Austrian meteorologist.
It is also known as the Cosine Bell. Some authors prefer that it be
called a Hann window, to help avoid confusion with the very similar
Hamming window.
Most references to the Hanning window come from the signal processing
literature, where it is used as one of many windowing functions for
smoothing values. It is also known as an apodization (which means
“removing the foot”, i.e. smoothing discontinuities at the beginning
and end of the sampled signal) or tapering function.
References
Examples
(
A
))
with
np
.
errstate
(
divide
=
'ignore'
,
invalid
=
'ignore'
):
response
=
20
*
np
.
log10
(
mag
)
response
=
np
.
clip
(
response
,
-
100
,
100
)
plt
.
plot
(
freq
,
response
)
plt
.
title
(
"Frequency response of the Hann window"
)
plt
.
ylabel
(
"Magnitude [dB]"
)
plt
.
xlabel
(
"Normalized frequency [cycles per sample]"
)
plt
.
axis
(
'tight'
)
plt
.
show
()