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

# hamming

Hamming window

## Syntax

``w = hamming(L)``
``w = hamming(L,sflag)``

## Description

example

````w = hamming(L)` returns an `L`-point symmetric Hamming window.```
````w = hamming(L,sflag)` returns a Hamming window using the window sampling specified by `sflag`.```

## Examples

collapse all

Create a 64-point Hamming window. Display the result using `wvtool`.

```L = 64; wvtool(hamming(L))```

## Input Arguments

collapse all

Window length, specified as a positive integer.

Data Types: `single` | `double`

Window sampling, specified as one of the following:

• `'symmetric'` — Use this option when using windows for filter design.

• `'periodic'` — This option is useful for spectral analysis because it enables a windowed signal to have the perfect periodic extension implicit in the discrete Fourier transform. When `'periodic'` is specified, `hamming` computes a window of length L + 1 and returns the first L points.

Data Types: `char`

## Output Arguments

collapse all

Hamming window, returned as a column vector.

## Algorithms

The following equation generates the coefficients of a Hamming window are computed from the :

`$w\left(n\right)=\begin{array}{cc}0.54-0.46\mathrm{cos}\left(2\pi \frac{n}{N}\right),& 0\le n\le N\end{array}.$`

The window length L = N + 1.

## References

[1] Oppenheim, Alan V., Ronald W. Schafer, and John R. Buck. Discrete-Time Signal Processing. Upper Saddle River, NJ: Prentice Hall, 1999.