Investment Studio > Expressions > Functions > DSP > HAMMING

Vector form: float array[1][length] hamming(integer length)

Returns a row vector (one row, length columns) containing the values of a Hamming window starting at position 1 and ending at position length > 1.

Scalar form: float hamming(integer length, integer position)

Returns the value in position >= 1 of a Hamming window starting at position 1 and ending at position length > 1.

The Hamming window function is defined as

omega = 2.0 * PI / (length - 1)

n = position - 1

hamming[n] = 0.54 - 0.46 * cos(n * omega)

Example

The graph source

=hamming(100, x)

can be used to create the following graph:

See also blackman, convolve, hanning, rectangle, triangle.