dpnp.sinc

dpnp.sinc(x, out=None, order='K')

Return the normalized sinc function.

The sinc function is equal to \(\sin(\pi x)/(\pi x)\) for any argument \(x\ne 0\). sinc(0) takes the limit value 1, making sinc not only everywhere continuous but also infinitely differentiable.

For full documentation refer to numpy.sinc.

Parameters:
  • x ({dpnp.ndarray, usm_ndarray}) -- Input array, expected to have floating-point data type.

  • out ({None, dpnp.ndarray, usm_ndarray}, optional) -- Output array to populate. Array must have the correct shape and the expected data type. Default: None.

  • order ({"C", "F", "A", "K"}, optional) -- Memory layout of the newly output array, if parameter out is None. Default: "K".

Returns:

out -- An array containing the element-wise result of the sinc(x) function. The data type of the returned array is determined by the Type Promotion Rules.

Return type:

dpnp.ndarray

Notes

The name sinc is short for "sine cardinal" or "sinus cardinalis".

The sinc function is used in various signal processing applications, including in anti-aliasing, in the construction of a Lanczos resampling filter, and in interpolation.

For bandlimited interpolation of discrete-time signals, the ideal interpolation kernel is proportional to the sinc function.

Examples

>>> import dpnp as np
>>> x = np.linspace(-4, 4, 41, dtype=np.float64)
>>> np.sinc(x) # result may vary
    array([ 0.        , -0.04923628, -0.08409186, -0.08903844, -0.05846808,
            0.        ,  0.06682066,  0.11643488,  0.12613779,  0.08504448,
            0.        , -0.10394325, -0.18920668, -0.21623621, -0.15591488,
            0.        ,  0.23387232,  0.50455115,  0.75682673,  0.93548928,
            1.        ,  0.93548928,  0.75682673,  0.50455115,  0.23387232,
            0.        , -0.15591488, -0.21623621, -0.18920668, -0.10394325,
            0.        ,  0.08504448,  0.12613779,  0.11643488,  0.06682066,
            0.        , -0.05846808, -0.08903844, -0.08409186, -0.04923628,
            0.        ])