HammingWindow#

  • Domain: ai.onnx

  • Since version: 17

Generates a Hamming window as described in the paper https://ieeexplore.ieee.org/document/1455106.

Inputs

  • size (T1): A scalar value indicating the length of the window.

Outputs

  • output (T2): A Hamming window with length: size. The output has the shape: [size].

Type Constraints

  • T1: Constrain the input size to int32_t or int64_t. Allowed types: tensor(int32), tensor(int64).

  • T2: Constrain output types to numeric tensors. Allowed types: tensor(bfloat16), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8).

Examples#

test_cc_hammingwindow

Node:
  HammingWindow(x) -> (y)
Inputs:
  x: shape=(), dtype=int32
    10

Outputs:
  y: shape=(10,), dtype=float32
    [0.08695652, 0.17414442, 0.4024053 , 0.68455124, 0.9128121 , 1.        ,
     0.9128121 , 0.68455124, 0.4024053 , 0.17414442]

test_cc_hammingwindow_symmetric

Node:
  HammingWindow(x) -> (y)
  Attributes:
    periodic = 0
Inputs:
  x: shape=(), dtype=int32
    10

Outputs:
  y: shape=(10,), dtype=float32
    [0.08695652, 0.19376232, 0.4642041 , 0.7717391 , 0.9724684 , 0.9724684 ,
     0.7717391 , 0.4642041 , 0.19376232, 0.08695652]