conv_mult

dnois.fourier.conv_mult(f1s: Sequence[Tensor], f2: Tensor, dims: Sequence[int], spacing: float | Tensor | Sequence[float | Tensor] = None, out: Literal['full', 'same', 'valid'] = 'full', padding: int | Sequence[int] | str = 'linear', simpson: bool = True, real: bool = None) list[Tensor]

Compute the convolutions between each signal in f1s and f2. The FFT of f2 is computed only once by calling ft4conv(), then passed to conv_partial() to compute convolutions. This is more efficient than calling conv() multiple times. By default, Simpson’s rule and DFT-scale are only applied to f2.

Shapes of tensors in f1s on dimensions dims should be identical. Additionally, FFT for real signals is applicable only if real is True and all the tensors in f1s are real tensors.

See also

dconv_mult() is the discrete counterpart of this function which drops spacing and simpson.

Parameters:
  • f1s (Sequence[Tensor]) – A sequence of tensors as one convolution operand.

  • f2 (Tensor) – The common tensor as another convolution operand.

  • dims (Sequence[int]) – Dimensions to be convolved.

  • spacing (float, Tensor or Sequence[float, Tensor]) – See conv().

  • out (str) – See dconv().

  • padding (int, Sequence[int] or str) – See dconv().

  • simpson (bool) – See conv().

  • real (bool) – See dconv().

Returns:

A list of tensors representing convolutions between signals in f1s and f2.

Return type:

list[Tensor]