clamp_init#

hypercoil.init.freqfilter.clamp_init(*, shape: Tuple[int, ...], filter_specs: Sequence[FreqFilterSpec], key: PRNGKey | None = None)[source]#

Filter clamp initialisation.

Initialise two tensors such that the first masks the points of a filter’s transfer function to be clamped and the second contains the clamping values.

Dimension:
points_tensor : \((*, F, N)\)

F denotes the total number of filters to initialise from the provided specs, and N denotes the number of frequency bins.

values_tensor : \((*, F, N)\)

As above

Parameters:
shapeTuple[int, …]

Shape of the tensors to initialise.

filter_specslist(FreqFilterSpec)

A list of filter specifications implemented as FreqFilterSpec objects.

Returns:
points_tensorTensor

A boolean tensor of shape shape that masks the points of a filter’s transfer function to be clamped.

values_tensorTensor

A tensor of shape shape that contains the clamping values.