Windows Package
Craig Stuart Sapp <[email protected]>
25 Feb 1997
Getting StartedLoad the windows package by placing the pathname to the Windows package below:
<< "Windows.m"
Windows are created in two steps: First, a continuous function describing the window is defined over the domain [-1,1]. This continuous function is the name of the window followed by the letter ’F’, for example TriangleF. Next, a discrete window is sampled from this continuous function by a function using the window name and ending in the letter ’W’. A few windows have variable parameters, such as the Kaiser window. You can see if a window has any extra parameters by typing Options[windowName] (without the ’F’ or ’W’ ending).
Options @Kaiser D
8Alpha Æ 2. <
The variable $Windows contains a list of all possible window types from the windows package.
$Windows
8Blackman, BlackmanHarris, Bohman, Cauchy, Cosine, Gaussian, Hamming,Hann, HannPoisson, Kaiser, Poisson, Rectangle, Reisz, Riemann,Triangle, Turkey, VallePoussin <
To get information on a particular type of Window:
? Blackman
BlackmanW@length, options D returns the Blackman window.
There are two plotting function designed for plotting continuous windows, and their transforms: WindowPlot, and WindowTransformPlot.
Double-click to the right of the headings below to open/close sections of this notebook.
Rectangle Window
Plot @RectangleF @xD, 8x, −1.1, 1.1 <D;
-1 -0.5 0.5 1
0.2
0.4
0.6
0.8
1
Or use the built-in function to plot a window in a standardized style:
WindowPlot @Rectangle D;
-1 -0.5 0 0.5 1
0
0.25
0.5
0.75
1
Rectangle Window
0
0.25
0.5
0.75
1
2 Windows.nb
WindowTransformPlot @Rectangle, PlotRange −> 8−37, 0 <D;
-35
-30
-25
-20
-15
-10
-5
0dB
Rectangle Window Transform
SeqPlot @RectangleW @9DD;
1 2 3 4 5 6 7 8
0.2
0.4
0.6
0.8
1
Windows.nb 3
Triangle Window
WindowPlot @Triangle D;
-1 -0.5 0 0.5 1
0
0.25
0.5
0.75
1
Triangle Window
0
0.25
0.5
0.75
1
WindowTransformPlot @Triangle, PlotRange −> 8−65, 0 <D;
-60
-50
-40
-30
-20
-10
0
dB
Triangle Window Transform
4 Windows.nb
SeqPlot @TriangleW @9DD;
1 2 3 4 5 6 7 8
0.2
0.4
0.6
0.8
1
SeqPlot @TriangleW @9, Causal −> False D, Causal −> False D;
-1-2-3-4 1 2 3 4
0.2
0.4
0.6
0.8
1
Cos^n Window
Options @Cosine D
8Power Æ 1<
Windows.nb 5
WindowPlot @Cosine D;
-1 -0.5 0 0.5 1
0
0.25
0.5
0.75
1
Cosine Window
0
0.25
0.5
0.75
1
WindowTransformPlot @Cosine, PlotRange −> 8−69, 0 <D;
-60
-50
-40
-30
-20
-10
0
dB
Cosine Window Transform
6 Windows.nb
SeqPlot @CosineW @9DD;
1 2 3 4 5 6 7 8
0.2
0.4
0.6
0.8
1
WindowPlot @Cosine, Power −> 2, Title −> "Cosine^2 Window" D;
-1 -0.5 0 0.5 1
0
0.25
0.5
0.75
1
Cosine^2 Window
0
0.25
0.5
0.75
1
Windows.nb 7
WindowTransformPlot @Cosine, Power −> 2, PlotRange −> 8−105, 0 <D;
-100
-80
-60
-40
-20
0dB
Cosine Window Transform
SeqPlot @CosineW @9, Power −> 2DD;
1 2 3 4 5 6 7 8
0.2
0.4
0.6
0.8
1
There are additional window functions called CosinLobeW which sets PowerÆ1, and RaisedCosineW function which sets PowerÆ2.
8 Windows.nb
SeqPlot @CosineLobeW @9DD;
1 2 3 4 5 6 7 8
0.2
0.4
0.6
0.8
1
Hann Window
WindowPlot @Hann D;
-1 -0.5 0 0.5 1
0
0.25
0.5
0.75
1
Hann Window
0
0.25
0.5
0.75
1
Windows.nb 9
WindowTransformPlot @Hann, PlotRange −> 8−105, 0 <D;
-100
-80
-60
-40
-20
0dB
Hann Window Transform
The Hann window is the same as a Cos^2 window:
Chop@CosineW @21, Power −> 2D − HannW@21DD
80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 <
SeqPlot @HannW@9DD;
1 2 3 4 5 6 7 8
0.2
0.4
0.6
0.8
1
10 Windows.nb
Hamming Window
Options @HammingD
9Alpha Æ25ÄÄÄÄÄÄÄÄ46
=
WindowPlot @Hamming, Alpha −> 25 ê 46, Title −> "Hamming Window α→0.54" D;
-1 -0.5 0 0.5 1
0
0.25
0.5
0.75
1
Hamming Window aÆ0.54
0
0.25
0.5
0.75
1
WindowTransformPlot @Hamming, PlotRange −> 8−55, 0 <D;
-50
-40
-30
-20
-10
0
dB
Hamming Window Transform
The Hann window is the same as a Hamming window with a=0.5:
Windows.nb 11
SeqPlot @HammingW@9DD;
1 2 3 4 5 6 7 8
0.2
0.4
0.6
0.8
1
Chop@HannW@21D − HammingW@21, Alpha −> 0.5 DD
80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 <
Blackman Window
Options @Blackman D êê N
8A0 Æ 0.426591, A1 Æ 0.496561, A2 Æ 0.0768487 <
12 Windows.nb
WindowPlot @Blackman,Title −> "Blackman Window a0 →.427 a1 →.497 a2 →.077" D;
-1 -0.5 0 0.5 1
0
0.25
0.5
0.75
1
Blackman Window a0Æ.427 a1Æ.497 a2Æ.077
0
0.25
0.5
0.75
1
WindowTransformPlot @Blackman, PlotRange −> 8−75, 0 <D;
-70
-60
-50
-40
-30
-20
-10
0
dB
Blackman Window Transform
Windows.nb 13
SeqPlot @BlackmanW@9DD;
1 2 3 4 5 6 7 8
0.2
0.4
0.6
0.8
1
Note that the Blackman window does not get to 0 at is edges:
BlackmanF @1D
0.00687876
Blackman-Harris WindowDefault parameters are for the 4-Term -96dB Blackman-Harris window:
Options @BlackmanHarris D
8A0 Æ 0.35875, A1 Æ 0.48829, A2 Æ 0.14128, A3 Æ 0.01168 <
14 Windows.nb
WindowPlot @BlackmanHarris, Title −> "Blackman −Harris Window" D;
-1 -0.5 0 0.5 1
0
0.25
0.5
0.75
1
Blackman-Harris Window
0
0.25
0.5
0.75
1
WindowTransformPlot @BlackmanHarris, PlotRange −> 8−125, 0 <D;
-120
-100
-80
-60
-40
-20
0
dB
BlackmanHarris Window Transform
Windows.nb 15
SeqPlot @BlackmanHarrisW @9DD;
1 2 3 4 5 6 7 8
0.2
0.4
0.6
0.8
1
Kaiser Window
Options @Kaiser D
8Alpha Æ 2. <
WindowPlot @Kaiser, Title −> "Kaiser Window α→2.0" D;
-1 -0.5 0 0.5 1
0
0.25
0.5
0.75
1
Kaiser Window aÆ2.0
0
0.25
0.5
0.75
1
16 Windows.nb
WindowTransformPlot @Kaiser, PlotRange −> 8−75, 0 <D;
-70
-60
-50
-40
-30
-20
-10
0
dB
Kaiser Window Transform
SeqPlot @KaiserW @9, Alpha −> 3.0 DD;
1 2 3 4 5 6 7 8
0.2
0.4
0.6
0.8
1
Windows.nb 17
Less Common Windows
Riesz Window
WindowPlot @Reisz D;
-1 -0.5 0 0.5 1
0
0.25
0.5
0.75
1
Reisz Window
0
0.25
0.5
0.75
1
WindowTransformPlot @Reisz, PlotRange −> 8−65, 0 <D;
-60
-50
-40
-30
-20
-10
0
dB
Reisz Window Transform
18 Windows.nb
SeqPlot @ReiszW @9DD;
1 2 3 4 5 6 7 8
0.2
0.4
0.6
0.8
1
Riemann Window
WindowPlot @Riemann D;
-1 -0.5 0 0.5 1
0
0.25
0.5
0.75
1
Riemann Window
0
0.25
0.5
0.75
1
Windows.nb 19
WindowTransformPlot @Riemann, PlotRange −> 8−65, 0 <D;
-60
-50
-40
-30
-20
-10
0dB
Riemann Window Transform
SeqPlot @RiemannW@9DD;
1 2 3 4 5 6 7 8
0.2
0.4
0.6
0.8
1
20 Windows.nb
de la Vallé-Poussin Window
WindowPlot @VallePoussin, Title −> "de la Vallé −Poussin Window" D;
-1 -0.5 0 0.5 1
0
0.25
0.5
0.75
1
de la Vallé-Poussin Window
0
0.25
0.5
0.75
1
WindowTransformPlot @VallePoussin, PlotRange −> 8−105, 0 <D;
-100
-80
-60
-40
-20
0
dB
VallePoussin Window Transform
Windows.nb 21
SeqPlot @VallePoussinW @19DD;
2 4 6 8 10 12 14 16 18
0.2
0.4
0.6
0.8
1
Turkey Window
WindowPlot @Turkey, Taper −> 0.5, Title −> "Turkey Window Taper →0.5" D;
-1 -0.5 0 0.5 1
0
0.25
0.5
0.75
1
Turkey Window TaperÆ0.5
0
0.25
0.5
0.75
1
22 Windows.nb
WindowTransformPlot @Turkey, Taper −> 0.5, PlotRange −> 8−85, 0 <D;
-80
-60
-40
-20
0dB
Turkey Window Transform
WindowPlot @Turkey, Taper −> 0.75, Title −> "Turkey Window Taper →0.75" D;
-1 -0.5 0 0.5 1
0
0.25
0.5
0.75
1
Turkey Window TaperÆ0.75
0
0.25
0.5
0.75
1
Windows.nb 23
WindowTransformPlot @Turkey, Taper −> 0.75, PlotRange −> 8−95, 0 <D;
-80
-60
-40
-20
0dB
Turkey Window Transform
SeqPlot @TurkeyW @19DD;
2 4 6 8 10 12 14 16 18
0.2
0.4
0.6
0.8
1
24 Windows.nb
Bohman Window
WindowPlot @BohmanD;
-1 -0.5 0 0.5 1
0
0.25
0.5
0.75
1
Bohman Window
0
0.25
0.5
0.75
1
WindowTransformPlot @Bohman, PlotRange −> 8−105, 0 <D;
-100
-80
-60
-40
-20
0
dB
Bohman Window Transform
Windows.nb 25
SeqPlot @BohmanW@19DD;
2 4 6 8 10 12 14 16 18
0.2
0.4
0.6
0.8
1
Poisson Window
Options @Poisson D
8Alpha Æ 2. <
WindowPlot @Poisson, Title −> "Poisson Window α→2.0" D;
-1 -0.5 0 0.5 1
0
0.25
0.5
0.75
1
Poisson Window aÆ2.0
0
0.25
0.5
0.75
1
26 Windows.nb
WindowTransformPlot @Poisson, PlotRange −> 8−45, 0 <D;
-40
-30
-20
-10
0
dB
Poisson Window Transform
SeqPlot @PoissonW @19, Alpha −> 3.0 DD;
2 4 6 8 10 12 14 16 18
0.2
0.4
0.6
0.8
1
Hann–Poisson Window
This window is a multiplcation of the Hann window with the Poisson window.
Windows.nb 27
WindowPlot @HannPoisson, Title −> "Hann −Poisson Window α→2.0" D;
-1 -0.5 0 0.5 1
0
0.25
0.5
0.75
1
Hann-Poisson Window aÆ2.0
0
0.25
0.5
0.75
1
WindowTransformPlot @HannPoisson D;
-50
-40
-30
-20
-10
0
dB
HannPoisson Window Transform
28 Windows.nb
SeqPlot @HannPoissonW @19, Alpha −> 0.5 DD;
2 4 6 8 10 12 14 16 18
0.2
0.4
0.6
0.8
1
Cauchy Window
Options @Cauchy D
8Alpha Æ 2. <
WindowPlot @Cauchy, Alpha −> 2.0, Title −> "Cauchy Window α→2.0" D;
-1 -0.5 0 0.5 1
0
0.25
0.5
0.75
1
Cauchy Window aÆ2.0
0
0.25
0.5
0.75
1
Windows.nb 29
WindowTransformPlot @Cauchy, Alpha −> 3.0, PlotRange −> 8−55, 0 <D;
-50
-40
-30
-20
-10
0dB
Cauchy Window Transform
SeqPlot @CauchyW@19DD;
2 4 6 8 10 12 14 16 18
0.2
0.4
0.6
0.8
1
Gausian Window
Options @Gaussian D
8Alpha Æ 2. <
30 Windows.nb
WindowPlot @Gaussian, Title −> "Gaussian Window α→2.0" D;
-1 -0.5 0 0.5 1
0
0.25
0.5
0.75
1
Gaussian WindowaÆ2.0
0
0.25
0.5
0.75
1
WindowTransformPlot @Gaussian, PlotRange −> 8−55, 0 <D;
-50
-40
-30
-20
-10
0
dB
Gaussian Window Transform
Windows.nb 31
SeqPlot @GaussianW @19, Alpha −> 3.0 DD;
2 4 6 8 10 12 14 16 18
0.2
0.4
0.6
0.8
1
Dolph-Chebyshev Window
Note: there is no DolphChebyshevF continuous function due to the window generation algorithm.
SeqPlot @DolphChebyshevW @51, Causal −> False, Alpha −> 2.5 D,Points −> False, LineStyle −> Thickness @0.006 D, Causal −> False,Frame −> True, Axes −> False, FrameTicks −> Automatic D;
-20 -10 0 10 200
0.2
0.4
0.6
0.8
1
32 Windows.nb