pyffs.conv

convolve(f, h, T, T_c, N_FS, return_coef=False, reorder=True, axes=None)[source]

Convolve two N-dimensional functions with the same period using FFS on their discrete samples.

The Fourier Series coefficients of both functions are estimated via FFS and multiplied in order to perform the convolution.

The two functions must have the same period, period center, and number of Fourier Series coefficients. If a scalar is passed for each these, 1-D is assumed and the convolution is performed on the last axis.

Parameters:
  • f (ndarray) – (…, N_s1, N_s2, …, N_sD, …) function values at sampling points specified by ffsn_sample(). If provided in order expected by ffsn(), set reorder=False.

  • h (ndarray) – (…, N_s1, N_s2, …, N_sD, …) function values at sampling points specified by ffsn_sample(). If provided in order expected by ffsn(), set reorder=False.

  • T (int or array_like of floats) – Function period along each dimension.

  • T_c (int or array_like of floats) – Period mid-point for each dimension.

  • N_FS (int or array_like of ints) – Function bandwidth along each dimension.

  • return_coef (bool) – Whether to return coefficients or samples.

  • reorder (bool) – Whether samples need to be reordered to the order expected by ffsn().

  • axes (int or array_like of ints or None, optional) – Axes over which to compute the convolution. The default is over all axes.

Returns:

g – (…, N_sx, N_sy, …) vectors containing convolution between f and h at the same sampling points.

Return type:

ndarray