Main Content

sigwin.bartlett Class

Namespace: sigwin

Construct Bartlett window object

Description

Note

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

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

For N even, the following equation defines the Bartlett window:

w(n)={2nN10nN/2122nN1N/2nN1

For N odd, the equation for the Bartlett window is:

w(n)={2nN10n(N1)/222nN1(N1)/2+1nN1

Construction

H = sigwin.bartlett returns a Bartlett window object H of length 64.

H = sigwin.bartlett(Length) returns a Bartlett window object H of length Length. 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.

Properties

Length

Bartlett window length. The length requires 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.

Methods

generateGenerates Bartlett window
infoDisplay information about Bartlett window object
winwriteSave Bartlett window object values in ASCII file

Copy Semantics

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

Examples

collapse all

Generate a Bartlett window of length N = 16. Return its values as a column vector. Show information about the window object. Display the window.

H = sigwin.bartlett(16);

win = generate(H)
win = 16×1

         0
    0.1333
    0.2667
    0.4000
    0.5333
    0.6667
    0.8000
    0.9333
    0.9333
    0.8000
      ⋮

wininfo = info(H)
wininfo = 3x15 char array
    'Bartlett Window'
    '---------------'
    'Length  : 16   '

wvtool(H)

References

Oppenheim, Alan V., and Ronald W. Schafer. Discrete-Time Signal Processing. Upper Saddle River, NJ: Prentice Hall, 1989.