function hanning(M) {
    return generalized_cosine_window(M, 0.5);
}
Generates a Hanning window of length M.
See https://numpy.org/doc/stable/reference/generated/numpy.hanning.html for more information.

@param {number} M The length of the Hanning window to generate.
@returns {Float64Array} The generated Hanning window.