Tukey (tapered cosine) window
Compute 128-point Tukey windows with five different values of
r, or "tapers." Display the results using
L = 128; t0 = tukeywin(L,0); % Equivalent to a rectangular window t25 = tukeywin(L,0.25); t5 = tukeywin(L); % r = 0.5 t75 = tukeywin(L,0.75); t1 = tukeywin(L,1); % Equivalent to a Hann window wvtool(t0,t25,t5,t75,t1)
L — Window length
Window length, specified as a positive integer.
r — Cosine fraction
0.5 (default) | real scalar
Cosine fraction, specified as a real scalar. The Tukey window is a rectangular
window with the first and last
/2 percent of
the samples equal to parts of a cosine. For example, setting
= 0.5 produces a Tukey window where
1/2 of the
entire window length consists of segments of a phase-shifted cosine with period
= 1. If you specify
≤ 0, an
L-point rectangular window is
returned. If you specify
≥ 1, an
L-point von Hann window is
w — Tukey window
Tukey window, returned as a column vector.
The following equation defines the L-point Tukey window:
where x is an L-point linearly spaced vector
linspace. The parameter r is
the ratio of cosine-tapered section length to the entire window length with 0 ≤ r ≤ 1. For example, setting r = 0.5 produces a Tukey window where 1/2 of the entire window length consists of
segments of a phase-shifted cosine with period 2r = 1. If you
specify r ≤ 0, an L-point rectangular window is returned. If you
specify r ≥ 1, an L-point von Hann window is returned.
 Bloomfield, P. Fourier Analysis of Time Series: An Introduction. New York: Wiley-Interscience, 2000.
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Introduced before R2006a