Skip to content

Feature Request: add hann alias for incorrectly named hanning function, update hanning documentation #17303

@mruberry

Description

@mruberry

Currently NumPy has a function, hanning, that is documented as "return[ing] the Hanning window". See here:

https://numpy.org/doc/stable/reference/generated/numpy.hanning.html?highlight=hanning#numpy.hanning

This function is actually a misnomer for the Hann window. The window is named after Julius von Hann. Its Wikipedia article even mentions this confusion over its name:

"However, the erroneous 'Hanning' function is also heard of on occasion, derived from the paper in which it was named, where the term 'hanning a signal' was used to mean applying the Hann window to it. The confusion arose from the similar Hamming function, named after Richard Hamming."

The NumPy documentation also mentions the discrepancy:

"The Hanning was named for Julius von Hann, an Austrian meteorologist. It is also known as the Cosine Bell. Some authors prefer that it be called a Hann window, to help avoid confusion with the very similar Hamming window."

I don't know what the basis for this latter claim is. matlab, SciPy, TensorFlow and PyTorch use the name hann or hann_window.

I suggest adding an alias to satisfy existing NumPy users and those would prefer the correct name.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions