hanning ( n -- seq )


Vocabulary
math.extras

Inputs and outputs
nan integer
seqa sequence


Word description
Return the Hanning window.

Definition
USING: arrays kernel math math.functions sequences ;

IN: math.extras

: hanning ( n -- seq )
dup 1 <=
[ 1 = [ 1 1array ] [ { } ] if ]
[ [0,2pi] [ cos -0.5 * 0.5 + ] map! ] if ;