fenestration.pooling.raised_cosine#
- fenestration.pooling.raised_cosine(x: float | ndarray, transition_region_width: float = 0.5) ndarray#
Compute raised cosine window function.
Possible window function, giving the weighting in each direction for the spatial pooling performed during the construction of visual metamers.
- Parameters:
x – The distance in a direction
transition_region_width – The width of the transition region, parameter \(t\) in equation 9 from the online methods. Must lie between 0 and 1.
- Returns:
array – The value of the raised cosine window at each value of
x.- Raises:
ValueError – If
transition_region_widthis not between 0 and 1
Notes
For
xvalues outside the function’s domain, we return 0Equation 9 from the online methods of [3].
References