# tf.signal.hann_window

<br />

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 2 version](https://www.tensorflow.org/api_docs/python/tf/signal/hann_window) | [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/ops/signal/window_ops.py#L33-L55) |

Generate a [Hann window](https://en.wikipedia.org/wiki/Window_function#Hann_and_Hamming_windows).

#### View aliases


**Main aliases**

\`tf.contrib.signal.hann_window\`
**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.signal.hann_window`](https://www.tensorflow.org/api_docs/python/tf/signal/hann_window), \`tf.compat.v2.signal.hann_window\`

<br />

    tf.signal.hann_window(
        window_length, periodic=True, dtype=tf.dtypes.float32, name=None
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `window_length` | A scalar `Tensor` indicating the window length to generate. |
| `periodic` | A bool `Tensor` indicating whether to generate a periodic or symmetric window. Periodic windows are typically used for spectral analysis while symmetric windows are typically used for digital filter design. |
| `dtype` | The data type to produce. Must be a floating point type. |
| `name` | An optional name for the operation. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `Tensor` of shape `[window_length]` of type `dtype`. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | If `dtype` is not a floating point type. |

<br />