bartorch.hann_window

Contents

bartorch.hann_window#

bartorch.hann_window()#

Hann (raised-cosine) apodization window over a centred k-space grid.

The kernel is \(W(u) = \tfrac12 (1 + \cos(\pi u / r))\) for \(u < r\) and zero beyond, with \(u\) normalized as in fermi_window() and \(r\) the radius.

Parameters:
  • shape (tuple of int) – Grid shape, any number of axes.

  • radius (float, default=1.0) – Coordinate at which the window reaches zero, as a fraction of the Nyquist edge.

  • geometry ({"radial", "separable"}, default='radial') – As in fermi_window().

  • device (torch.device or str, default=None) – Device of the window.

Returns:

Real float32 window of shape shape.

Return type:

torch.Tensor

Raises:

ValueError – If radius is not positive, geometry is neither value, or an axis is empty.