blackman_window#

ivy.blackman_window(size, *, periodic=True, dtype=None, out=None)[source]#

Generate a Blackman window. The Blackman window is a taper formed by using the first three terms of a summation of cosines. It was designed to have close to the minimal leakage possible. It is close to optimal, only slightly worse than a Kaiser window.

Parameters:
  • window_length – the window_length of the returned window.

  • periodic (bool, default: True) – If True, returns a window to be used as periodic function. If False, return a symmetric window.

  • dtype (Optional[Union[Dtype, NativeDtype]], default: None) – The data type to produce. Must be a floating point type.

  • out (Optional[Array], default: None) – optional output array, for writing the result to.

Return type:

Array

Returns:

ret – The array containing the window.

Examples

>>> ivy.blackman_window(4, periodic = True)
ivy.array([-1.38777878e-17,  3.40000000e-01,  1.00000000e+00,  3.40000000e-01])
>>> ivy.blackman_window(7, periodic = False)
ivy.array([-1.38777878e-17,  1.30000000e-01,  6.30000000e-01,  1.00000000e+00,
    6.30000000e-01,  1.30000000e-01, -1.38777878e-17])
Array.blackman_window(self, /, *, periodic=True, dtype=None, device=None, out=None)[source]#

ivy.Array instance method variant of ivy.blackman_window. This method simply wraps the function, and so the docstring for ivy.blackman_window also applies to this method with minimal changes.

Parameters:
  • self (Array) – int.

  • periodic (bool, default: True) – If True, returns a window to be used as periodic function. If False, return a symmetric window. Default: True.

  • dtype (Optional[Union[Dtype, NativeDtype]], default: None) – output array data type. If dtype is None, the output array data type must be inferred from self. Default: None.

  • device (Optional[Union[Device, NativeDevice]], default: None) – device on which to place the created array. If device is None, the output array device must be inferred from self. Default: None.

  • out (Optional[Array], default: None) – optional output array, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Array

Returns:

ret – The array containing the window.

Examples

>>> ivy.blackman_window(4, periodic = True)
ivy.array([-1.38777878e-17,  3.40000000e-01,  1.00000000e+00,  3.40000000e-01])
>>> ivy.blackman_window(7, periodic = False)
ivy.array([-1.38777878e-17,  1.30000000e-01,  6.30000000e-01,  1.00000000e+00,
6.30000000e-01,  1.30000000e-01, -1.38777878e-17])
Container.blackman_window(self, periodic=True, dtype=None, *, out=None)[source]#

ivy.Container instance method variant of ivy.blackman_window. This method simply wraps the function, and so the docstring for ivy.blackman_window also applies to this method with minimal changes.

Parameters:
  • self (Container) – input container with window sizes.

  • periodic (bool, default: True) – If True, returns a window to be used as periodic function. If False, return a symmetric window.

  • dtype (Optional[Union[Dtype, NativeDtype]], default: None) – The data type to produce. Must be a floating point type.

  • out (Optional[Container], default: None) – optional output container, for writing the result to.

Return type:

Container

Returns:

ret – The container containing the Blackman windows.

Examples

With one ivy.Container input: >>> x = ivy.Container(a=3, b=5) >>> ivy.blackman_window(x) {

a: ivy.array([-1.38777878e-17, 6.30000000e-01, 6.30000000e-01]) b: ivy.array([-1.38777878e-17, 2.00770143e-01, 8.49229857e-01,

8.49229857e-01, 2.00770143e-01])

}