W_bartlettmultiplies the sequence in arrayAby a Bartlett window function and returns the product in arrayB. ArrayAis unmodified. IfNis the number of elements in the arrayAandkis the position in the arrayB, the formula for the window function,wk, is
In the above formula,kranges in value from 0 toN- 1.
If the arrayBcontains more elements thanA, the extra elements inBare unmodified.
The Bartlett window is a special case of the window generated by theW_trapezoidroutine.
Bartlett window forN=128
Errors
W_bartlettcauses an HTBasic error if its arguments are not both REAL arrays or ifBcontains fewer elements thanA.