represents a Hamming window function of x.
HammingWindow
represents a Hamming window function of x.
Details
- HammingWindow is a window function typically used for pulse shaping in telecommunication applications as well as for finite impulse response (FIR) filter design and spectral analysis.
- Window functions are used in applications where data is processed in short segments and have a smoothing effect by gradually tapering data values to zero at the ends of each segment.
- HammingWindow[x] is equal to
. - HammingWindow automatically threads over lists.
Examples
open all close allBasic Examples (3)
Plot[HammingWindow[x], {x, -1, 1}, Exclusions -> None]Plot3D[HammingWindow[x]HammingWindow[y], {x, -1, 1}, {y, -1, 1}, PlotRange -> All, Exclusions -> None]Extract the continuous function representing the Hamming window:
FunctionExpand[HammingWindow[x]]Scope (4)
HammingWindow[0.1]Translated and dilated Hamming window:
Plot[HammingWindow[(x - 1) / 2], {x, -1, 3}, Exclusions -> None]2D Hamming window with a circular support:
Plot3D[HammingWindow[Sqrt[x ^ 2 + y ^ 2]], {x, -1, 1}, {y, -1, 1}, PlotRange -> All, Exclusions -> None]Discrete Hamming window of length 15:
ListPlot[Array[HammingWindow, 15, {-1 / 2, 1 / 2}], Filling -> Axis]Discrete 15×10 2D Hamming window:
ListPointPlot3D[Array[HammingWindow[#1] HammingWindow[#2]&, {15, 10}, {{-1 / 2, 1 / 2}}], Filling -> Axis]Applications (3)
Create a moving average filter of length 21:
h = ConstantArray[1 / 11., 11]Taper the filter using a Hamming window:
w = Array[HammingWindow, Length[h], {-1 / 2, 1 / 2}];
fir = w h / Total[w h];Log-magnitude plot of the power spectra of the filters:
LogLinearPlot[Evaluate[20Log[10, Abs@ListFourierSequenceTransform[#, ω]]& /@ {h, fir}], {ω, 0.1, Pi}, GridLines -> Automatic]Use a window specification to calculate sample PowerSpectralDensity:
proc = ARMAProcess[1, {.5}, {.3}, 1];
data = RandomFunction[proc, {50}];spec = PowerSpectralDensity[data, w, HammingWindow];Compare to spectral density calculated without a windowing function:
sd = PowerSpectralDensity[data, w];sd === specThe plot shows that window smooths the spectral density:
Plot[{sd, spec}, {w, -π, π}, PlotRange -> All, PlotLegends -> {"no window", "with window"}]Compare to the theoretical spectral density of the process:
Plot[{spec, Evaluate@PowerSpectralDensity[proc, w]}, {w, -π, π}, PlotLegends -> {"data", "process"}]Use a window specification for time series estimation:
data = RandomFunction[ARMAProcess[1, {.3}, {.4}, 1], {300}];Specify window for spectral estimator:
EstimatedProcess[data, ARMAProcess[1, 1], ProcessEstimator -> {"SpectralEstimator", "Window" -> HammingWindow}]Properties & Relations (4)
The area under the Hamming window:
area = Integrate[HammingWindow[x], {x, -∞, ∞}]Normalize to create a window with unit area:
Plot[{HammingWindow[x], HammingWindow[x] / area}, {x, -1, 1}, PlotRange -> All]Fourier transform of the Hamming window:
f = FourierTransform[HammingWindow[x], x, w]Power spectrum of the Hamming window:
LogLinearPlot[20 Log[10, Abs[f]], {w, .1, 80}]Discrete-time Fourier transform of the discrete Hamming window of length 11:
(f = ListFourierSequenceTransform[Array[HammingWindow, 11, {-1 / 2, 1 / 2}], ω, -5])//Shortf0 = N[f /. ω -> 0]Plot[Abs@f / f0, {ω, 0, π}, PlotRange -> All]Power spectra of the Hamming and rectangular windows:
tab = Table[(f = ListFourierSequenceTransform[Array[win, 25, {-1 / 2, 1 / 2}], ω, -12];
f0 = Limit[f, ω -> 0.];
20Log10[Abs@f / f0]), {win, {HammingWindow, DirichletWindow}}];LogLinearPlot[tab, {ω, 0.1, π}, PlotRange -> {5, -80}, PlotLegends -> {HammingWindow, DirichletWindow}]See Also
Related Guides
History
Text
Wolfram Research (2012), HammingWindow, Wolfram Language function, https://reference.wolfram.com/language/ref/HammingWindow.html.
CMS
Wolfram Language. 2012. "HammingWindow." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/HammingWindow.html.
APA
Wolfram Language. (2012). HammingWindow. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/HammingWindow.html
BibTeX
@misc{reference.wolfram_2026_hammingwindow, author="Wolfram Research", title="{HammingWindow}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/HammingWindow.html}", note=[Accessed: 15-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_hammingwindow, organization={Wolfram Research}, title={HammingWindow}, year={2012}, url={https://reference.wolfram.com/language/ref/HammingWindow.html}, note=[Accessed: 15-June-2026]}