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
dimusing FFT.The angular-frequency impulse response is
h[0] = pi/2,h[k] = -2/(pi*k**2)for oddk, and zero for nonzero evenk(Kak and Slaney, chapter 3, equation 61, scaled by2*pi). Transforming this finite kernel preserves its small positive DC response and avoids the low-frequency bias of directly samplingabs(omega).pad_factor >= 2gives 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 of1/length, so the FFT output is rescaled by1 / sample_spacingto respect physical units.pad_factor (int, optional) – Zero-pad the signal to
pad_factor * Nalongdimbefore 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).