rcfilt#

torchspin.rcfilt(y, sample_time, time_constant, direction='up')[source]#

Apply an RC low-pass filter to a signal.

Models the analogue RC filter in CW EPR spectrometers.

Parameters:
  • y (array-like) – Input signal (1D or 2D; filtered along axis 0 for 2D).

  • sample_time (float) – Dwell time per point (same units as time_constant).

  • time_constant (float) – RC filter time constant (same units as sample_time).

  • direction (str) – 'up' (default) — forward filter (field swept upward). 'down' or 'dn' — reverse filter (field swept downward).

Returns:

y_filt (ndarray, same shape as *y.*)

Return type:

np.ndarray

Examples

>>> y_filt = rcfilt(spectrum, sample_time=1e-4, time_constant=5e-4)