prtools.sinc#

sinc(x1, x2, indexing='ij')[source]#

Normalized 2D sinc function

Parameters:
  • x1 (array_like) – 1-D arrays representing the grid coordinates

  • x2 (array_like) – 1-D arrays representing the grid coordinates

  • indexing ({'ij', 'xy'}, optional) – Matrix (‘ij’, default) or cartesian (‘xy’) indexing of output.

  • normalize (bool, optional) – If True, the output is normalized such that its sum is equal to 1. If False (default), the output has max equal to one.

Return type:

ndarray

See also

pixel_kernel()

Notes

This function uses numpy.sinc, which computes the sinc function as

\[\mbox{sinc}(x) = \frac{\sin \pi x}{\pi x}\]

Examples

>>> r = np.linspace(-3,3,512)
>>> c = np.linspace(-3,3,512)
>>> s = prtools.sinc(r, c)
>>> plt.imshow(s, cmap='gray', extent=[r.min(), r.max(), c.min(), c.max()])
../_images/prtools-sinc-1.png