lanczos

lanczos(dx, width, cutoff, /)[source]

Returns coefficients for Lanczos high-pass filter with desired wavelength specified. See this link.

Parameters
  • dx (float) – Units of your x-dimension, so that cutoff can be translated from physical units to ‘timestep’ units.

  • width (float) – Length of filter in time steps.

  • cutoff (float) – Cutoff wavelength in physical units.

Returns

  • b (array-like) – Numerator coeffs.

  • a (array-like) – Denominator coeffs.

Notes

  • The smoothing should only be approximate (see Hartmann notes), response function never exactly perfect like with Butterworth filter.

  • The cutoff parameter must be provided in time step units. Change the converter dx otherwise.

  • The ‘2’ factor appearing in multiple places may seem random. But this converts linear frequency (i.e. wavenumber) to angular frequency in sine call below. The ‘2’ doesn’t appear in any other factor just as a consequence of the math.