Main Content

sigwin.tukeywin Class

Namespace: sigwin

Construct Tukey window object

Description

Note

The use of sigwin.tukeywin is not recommended. Use tukeywin instead.

sigwin.tukeywin creates a handle to a Tukey window object for use in spectral analysis and FIR filtering by the window method. Object methods enable workspace import and ASCII file export of the window values.

The following equation defines the N–point Tukey window:

w(x)={12{1+cos(2πα[xα/2])}0x<α21α2x<1α212{1+cos(2πα[x1+α/2])}1α2x1

where x is a N–point linearly spaced vector generated using linspace. The parameter α is the ratio of cosine-tapered section length to the entire window length with 0 ≤α≤1. 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 2α=1. If you specify α≤0, an N-point rectangular window is returned. If you specify α≥1, a von Hann window (sigwin.hann) is returned.

Construction

H = sigwin.tukeywin returns a Tukey or cosine-tapered window object H of length 64 with Alpha parameter equal to 0.5.

H = sigwin.tukeywin(Length) returns a Tukey window object H of length Length with Alpha parameter equal to 0.5. Length requires a positive integer. Entering a positive noninteger value for Length rounds the length to the nearest integer.

H = sigwin.tukeywin(Length,Alpha) returns a Tukey window object with the ratio of the tapered section length to the entire window length Alpha. Alpha defaults to 0.5. As Alpha approaches zero, the Tukey window approaches a rectangular window. As Alpha approaches one, the Tukey window approaches a Hann window.

Properties

Length

Tukey window length. The window length must be a positive integer. Entering a positive noninteger value for Length rounds the length to the nearest integer. Entering a 1 for Length results in a window with a single value of 1.

Alpha

The ratio of tapered window section to constant section. As a ratio, Alpha satisfies the inequality 0α1. As Alpha approaches zero, the Tukey window approaches a rectangular window. As Alpha approaches one, the Tukey window approaches a Hann window. Specifying Alpha less than zero or greater than one replaces Alpha with 0 and 1 respectively.

Methods

generateGenerates Tukey window
infoDisplay information about Tukey window object
winwriteSave Tukey window in ASCII file

Copy Semantics

Handle. To learn how copy semantics affect your use of the class, see Copying Objects in the MATLAB® Programming Fundamentals documentation.

Examples

collapse all

Generate two Tukey windows of length N = 64:

  • The first window has α = 1/4. α is the ratio of tapered window section length to constant section length.

  • The second window has α = 3/4.

Display the two windows.

H14 = sigwin.tukeywin(64,1/4);
H34 = sigwin.tukeywin(64,3/4);

wvt = wvtool(H14,H34);
legend(wvt.CurrentAxes,'\alpha = 1/4','\alpha = 3/4')

Generate a Tukey window with length N = 16 and the default α = 1/2. Return its values as a column vector. Show information about the window object. Display the window.

H = sigwin.tukeywin(16);

win = generate(H)
win = 16×1

         0
    0.1654
    0.5523
    0.9045
    1.0000
    1.0000
    1.0000
    1.0000
    1.0000
    1.0000
      ⋮

wininfo = info(H)
wininfo = 4x13 char array
    'Tukey Window '
    '------------ '
    'Length  : 16 '
    'Alpha   : 0.5'

wvtool(H)

References

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