MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ apply_rectangular()

MAYAFLUX_API void MayaFlux::Kinesis::Discrete::apply_rectangular ( std::span< double >  data,
size_t  support = std::numeric_limits< size_t >::max(),
size_t  offset = 0 
)
noexcept

Apply a rectangular taper in-place without materialising coefficients.

Zeroes everything outside the support region and leaves the region itself untouched, since its coefficients are unity. The default arguments gate nothing and leave data unchanged.

Parameters
dataTarget span (modified in place)
supportWidth of the unity region; defaults to the full length
offsetIndex where the unity region begins

Definition at line 129 of file Taper.cpp.

130{
131 const size_t n = data.size();
132 if (n == 0 || support == 0) {
133 std::ranges::fill(data, 0.0);
134 return;
135 }
136
137 const size_t start = std::min(offset, n);
138 const size_t end = std::min(start + support, n);
139
140 for (size_t i = 0; i < start; ++i)
141 data[i] = 0.0;
142 for (size_t i = end; i < n; ++i)
143 data[i] = 0.0;
144}
float offset

References offset.

Referenced by MayaFlux::apply_window().

+ Here is the caller graph for this function: