product_filter#

hypercoil.functional.fourier.product_filter(X: Tensor, weight: Tensor, **params) Tensor[source]#

Convolve a multivariate signal via multiplication in the frequency domain.

Note

For a filter that is guaranteed to be zero-phase even when the weight tensor is not strictly real-valued, use product_filtfilt().

Dimension:
Input : \((N, *, obs)\)

N denotes batch size, * denotes any number of intervening dimensions, obs denotes number of observations per data channel.

Weight : \((*, \left\lfloor \frac{obs}{2} \right\rfloor + 1)\)

As above.

Output : \((N, *, 2 \left\lfloor \frac{obs}{2} \right\rfloor )\)

As above.

Parameters:
XTensor

The (potentially multivariate) signal to be filtered. The final axis should correspond to the time domain of each signal or its analogue.

weightTensor

The filter gain at each frequency bin in the spectrum, ordered low to high along the last axis. Dimensions before the last can be used to apply different filters to different variables in the input signal according to tensor broadcasting rules.

**params

Any additional parameters provided will be passed to jnp.fft.rfft and jnp.fft.irfft.

Returns:
Tensor

Original time series filtered via multiplication in the frequency domain.