ramp_filter_1d#

diffct.analytical.ramp_filter_1d(sinogram_tensor, dim=-1, sample_spacing=1.0, pad_factor=1, window=None, use_rfft=True)[source]#

Apply a finite discrete Ram-Lak filter along dim using FFT.

The angular-frequency impulse response is h[0] = pi/2, h[k] = -2/(pi*k**2) for odd k, and zero for nonzero even k (Kak and Slaney, chapter 3, equation 61, scaled by 2*pi). Transforming this finite kernel preserves its small positive DC response and avoids the low-frequency bias of directly sampling abs(omega). pad_factor >= 2 gives linear convolution over the retained samples for an unwindowed filter.

Parameters:
  • sinogram_tensor (torch.Tensor) – Real-valued sinogram tensor.

  • dim (int, optional) – Axis along which to filter. Default -1.

  • sample_spacing (float, optional) – Physical spacing between detector samples along dim. The continuous ramp filter has units of 1/length, so the FFT output is rescaled by 1 / sample_spacing to respect physical units.

  • pad_factor (int, optional) – Zero-pad the signal to pad_factor * N along dim before the FFT to suppress circular-convolution wrap-around artifacts.

  • window (str or None, optional) – Frequency-domain apodization: None / "ram-lak" (unwindowed), "hann", "hamming", "cosine", or "shepp-logan".

  • use_rfft (bool, optional) – Use the real-valued FFT path when True (default).