CosineWindow[x]
represents a cosine window function of x.
CosineWindow[x,α]
uses the exponent α.
CosineWindow
CosineWindow[x]
represents a cosine window function of x.
CosineWindow[x,α]
uses the exponent α.
Details
- CosineWindow 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.
- CosineWindow[x,α] is equal to
for
and 0 otherwise. - CosineWindow[x] is equivalent to CosineWindow[x,1].
- CosineWindow automatically threads over lists.
Examples
open all close allBasic Examples (3)
Plot[CosineWindow[x], {x, -1, 1}]Plot3D[CosineWindow[x]CosineWindow[y], {x, -1, 1}, {y, -1, 1}, PlotRange -> All]Extract the continuous function representing the cosine window:
FunctionExpand[CosineWindow[x]]FunctionExpand[CosineWindow[x, α]]Scope (6)
CosineWindow[0.1]Shape of a 1D cosine window using a specified exponent:
Plot[CosineWindow[x, 3], {x, -1, 1}]Variation of the shape as a function of the parameter α:
Plot3D[CosineWindow[x, α], {α, 0, 5}, {x, -1, 1}]Translated and dilated cosine window:
Plot[CosineWindow[(x - 1) / 2], {x, -1, 3}]2D cosine window with a circular support:
Plot3D[CosineWindow[Sqrt[x ^ 2 + y ^ 2]], {x, -1, 1}, {y, -1, 1}, PlotRange -> All]Discrete cosine window of length 15:
ListPlot[Array[CosineWindow, 15, {-1 / 2, 1 / 2}], Filling -> Axis]Discrete 15×10 2D cosine window:
ListPointPlot3D[Array[CosineWindow[#1] CosineWindow[#2]&, {15, 10}, {{-1 / 2, 1 / 2}}], Filling -> Axis]Applications (3)
Create a moving-average filter of length 11:
h = ConstantArray[1 / 11., 11]Taper the filter using a cosine window:
w = Array[CosineWindow, Length[h], {-1 / 2, 1 / 2}];
fir = w h / Total[w h];Log-magnitude plot of the power spectra of the two 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, CosineWindow];Compare to spectral density calculated without a windowing function:
sd = PowerSpectralDensity[data, w];sd === specThe plot shows that the 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 the window for the spectral estimator:
EstimatedProcess[data, ARMAProcess[1, 1], ProcessEstimator -> {"SpectralEstimator", "Window" -> CosineWindow}]Properties & Relations (3)
CosineWindow[x,0] is equivalent to a Dirichlet window:
FunctionExpand[CosineWindow[x, 0]] == FunctionExpand[DirichletWindow[x]]The area under the cosine window:
area = Integrate[CosineWindow[x], {x, -∞, ∞}]Normalize to create a window with unit area:
Plot[{CosineWindow[x], CosineWindow[x] / area}, {x, -1, 1}]Fourier transform of the cosine window:
f = FourierTransform[CosineWindow[x], x, w]Power spectrum of the cosine window:
LogLinearPlot[20 Log[10, Abs[f]], {w, .1, 80}]Possible Issues (1)
2D sampling of cosine window uses a different exponent for each row of samples when passed as a symbol to Array:
Array[CosineWindow, {30, 30}, {{-.5, .5}}]//N//ListPlot3DArray[CosineWindow[#1] CosineWindow[#2]&, {30, 30}, {{-1 / 2, 1 / 2}}]//ListPlot3DRelated Guides
History
Text
Wolfram Research (2012), CosineWindow, Wolfram Language function, https://reference.wolfram.com/language/ref/CosineWindow.html.
CMS
Wolfram Language. 2012. "CosineWindow." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CosineWindow.html.
APA
Wolfram Language. (2012). CosineWindow. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CosineWindow.html
BibTeX
@misc{reference.wolfram_2026_cosinewindow, author="Wolfram Research", title="{CosineWindow}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/CosineWindow.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_cosinewindow, organization={Wolfram Research}, title={CosineWindow}, year={2012}, url={https://reference.wolfram.com/language/ref/CosineWindow.html}, note=[Accessed: 12-June-2026]}