Documentation

tukeywin

Tukey (tapered cosine) window

Syntax

w = tukeywin(L,r)

Description

w = tukeywin(L,r)returns anL-point Tukey window in the column vector,w. A Tukey window is a rectangular window with the first and lastr/2percent of the samples equal to parts of a cosine. SeeAlgorithmsfor the equation that defines the Tukey window.ris a real number between 0 and 1. If you inputr≤ 0, you obtain arectwinwindow. If you inputr≥ 1, you obtain ahannwindow.rdefaults to 0.5.

Examples

collapse all

Compute 128-point Tukey windows with five different values ofr, or "tapers." Display the results usingwvtool.

L = 128; t0 = tukeywin(L,0);% Equivalent to a rectangular windowt25 = tukeywin(L,0.25); t5 = tukeywin(L);% r = 0.5t75 = tukeywin(L,0.75); t1 = tukeywin(L,1);% Equivalent to a Hann windowwvtool(t0,t25,t5,t75,t1)

Algorithms

The following equation defines theL-point Tukey window:

w ( x ) = { 1 2 { 1 + cos ( 2 π r [ x r / 2 ] ) } , 0 x < r 2 1 , r 2 x < 1 r 2 1 2 { 1 + cos ( 2 π r [ x 1 + r / 2 ] ) } , 1 r 2 x 1

wherexis anL-point linearly spaced vector generated usinglinspace. The parameterris the ratio of cosine-tapered section length to the entire window length with0 ≤r≤ 1. For example, settingr= 0.5produces 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 specifyr≤ 0, anL分返回矩形窗口。如果你规范ifyr≥ 1, anL-point von Hann window is returned.

References

[1] Bloomfield, P. Fourier Analysis of Time Series: An Introduction. New York: Wiley-Interscience, 2000.

Extended Capabilities

Introduced before R2006a

Was this topic helpful?