# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English verison of the page.

# sigwin.triang class

Package: sigwin

Construct triangular window object

## Description

### Note

The use of `sigwin.triang` is not recommended. Use `triang` instead.

`sigwin.triang` is a triangular window object.

`sigwin.triang` creates a handle to a triangular 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.

For L odd, the triangular window is defined as:

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

For L even, the triangular window is defined as:

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

## Construction

`H = sigwin.triang` returns a triangular window object `H` of length 64.

`H = sigwin.triang(Length)` returns a triangular window object `H` of length `Length`. Entering a positive non-integer 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` Triangular window length. The window length requires a positive integer. Entering a positive non-integer 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 triangular window info Display information about triangular window winwrite Save triangular window in ASCII file

## Copy Semantics

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

## Examples

expand all

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

```H = sigwin.triang(16); win = generate(H)```
```win = 0.0625 0.1875 0.3125 0.4375 0.5625 0.6875 0.8125 0.9375 0.9375 0.8125 ```
`wininfo = info(H)`
```wininfo = 3x17 char array 'Triangular Window' '-----------------' 'Length : 16 ' ```
`wvtool(H)`

## References

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