Accelerating the pace of engineering and science

# sigwin.bartlett class

Package: sigwin

Construct Bartlett window object

## Description

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\left(n\right)=\left\{\begin{array}{ll}\frac{2n}{N-1}\hfill & 0\le n\le N/2-1\hfill \\ 2-\frac{2n}{N-1}\hfill & N/2\le n\le N-1\hfill \end{array}$

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

$w\left(n\right)=\left\{\begin{array}{ll}\frac{2n}{N-1}\hfill & 0\le n\le \left(N-1\right)/2\hfill \\ 2-\frac{2n}{N-1}\hfill & \left(N-1\right)/2+1\le n\le N-1\hfill \end{array}$

## 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

 generate Generates Bartlett window info Display information about Bartlett window object winwrite Save 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

Create default length N=64 Bartlett window:

```H = sigwin.bartlett;
wvtool(H); ```

Generate length N=128 Bartlett window, return values, and write ASCII file with window values:

```H = sigwin.bartlett(128);
% Return window with generate
win = generate(H);
% Write ASCII file in current directory
% with window values
winwrite(H,'bartlett_128')```

## References

Oppenheim, A.V., and Schafer, R.W. Discrete-time Signal Processing, Upper Saddle River, N.J: Prentice Hall, 1989, pp. 444–447.