represents a Bartlett–Hann window function of x.
BartlettHannWindow
represents a Bartlett–Hann window function of x.
Details
- BartlettHannWindow is a window function typically used in signal processing applications where data needs to be processed in short segments.
- Window functions have a smoothing effect by gradually tapering data values to zero at the ends of each segment.
- BartlettHannWindow[x] is equal to
. - BartlettHannWindow automatically threads over lists.
Examples
open all close allBasic Examples (3)
Shape of a 1D Bartlett–Hann window:
Plot[BartlettHannWindow[x], {x, -1, 1}]Shape of a 2D Bartlett–Hann window:
Plot3D[BartlettHannWindow[x]BartlettHannWindow[y], {x, -1, 1}, {y, -1, 1}, PlotRange -> All]Extract the continuous function representing the Bartlett–Hann window:
FunctionExpand[BartlettHannWindow[x]]Scope (4)
BartlettHannWindow[0.1]Translated and dilated Bartlett–Hann window:
Plot[BartlettHannWindow[(x - 1) / 2], {x, -1, 3}]2D Bartlett–Hann window with a circular support:
Plot3D[BartlettHannWindow[Sqrt[x ^ 2 + y ^ 2]], {x, -1, 1}, {y, -1, 1}, PlotRange -> All]Discrete Bartlett–Hann window of length 15:
ListPlot[Array[BartlettHannWindow, 15, {-1 / 2, 1 / 2}], Filling -> Axis]Discrete 15×10 2D Bartlett–Hann window:
ListPointPlot3D[Array[BartlettHannWindow[#1] BartlettHannWindow[#2]&, {15, 10}, {{-1 / 2, 1 / 2}}], Filling -> Axis]Applications (3)
Create a moving average filter of length 11:
a = ConstantArray[1 / 11, 11]Smooth the filter using a Bartlett–Hann window:
a2 = # / Total[#]&[a Array[BartlettHannWindow, 11, {-1 / 2, 1 / 2}]];Log-magnitude plot of the frequency spectrum of the filters:
LogLinearPlot[Evaluate[20Log[10, Abs@ListFourierSequenceTransform[#, ω]]& /@ {a, a2}], {ω, 0.0314, Pi}, PlotRange -> All, GridLines -> Automatic, ImageSize -> 300]Use a window specification to calculate sample PowerSpectralDensity:
proc = ARMAProcess[1, {.5}, {.3}, 1];
data = RandomFunction[proc, {50}];spec = PowerSpectralDensity[data, w, BartlettHannWindow];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" -> BartlettHannWindow}]Properties & Relations (2)
The area under the Bartlett–Hann window:
area = Integrate[BartlettHannWindow[x], {x, -∞, ∞}]Normalize to create a window with unit area:
Plot[{BartlettHannWindow[x], BartlettHannWindow[x] / area}, {x, -1, 1}]Fourier transform of the Bartlett–Hann window:
f = FourierTransform[BartlettHannWindow[x], x, w]Power spectrum of the Bartlett–Hann window:
LogLinearPlot[20 Log[10, Abs[f]], {w, .1, 80}]Related Guides
History
Text
Wolfram Research (2012), BartlettHannWindow, Wolfram Language function, https://reference.wolfram.com/language/ref/BartlettHannWindow.html.
CMS
Wolfram Language. 2012. "BartlettHannWindow." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/BartlettHannWindow.html.
APA
Wolfram Language. (2012). BartlettHannWindow. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/BartlettHannWindow.html
BibTeX
@misc{reference.wolfram_2026_bartletthannwindow, author="Wolfram Research", title="{BartlettHannWindow}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/BartlettHannWindow.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_bartletthannwindow, organization={Wolfram Research}, title={BartlettHannWindow}, year={2012}, url={https://reference.wolfram.com/language/ref/BartlettHannWindow.html}, note=[Accessed: 13-June-2026]}