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

◆ compute_range_statistic()

std::vector< double > MayaFlux::Yantra::compute_range_statistic ( std::span< const double >  data,
const size_t  num_windows,
const uint32_t  hop_size,
const uint32_t  window_size 
)

Compute range statistic using zero-copy processing.

Definition at line 685 of file AnalysisHelper.cpp.

686{
687 std::vector<double> range_values(num_windows);
688
689 std::vector<size_t> indices(num_windows);
690 std::iota(indices.begin(), indices.end(), 0);
691
692 std::for_each(std::execution::par_unseq, indices.begin(), indices.end(),
693 [&](size_t i) {
694 const size_t start_idx = i * hop_size;
695 const size_t end_idx = std::min(start_idx + window_size, data.size());
696 auto window = data.subspan(start_idx, end_idx - start_idx);
697
698 auto [min_it, max_it] = std::ranges::minmax_element(window);
699 range_values[i] = *max_it - *min_it;
700 });
701
702 return range_values;
703}

References compute_range_statistic().

Referenced by compute_range_statistic(), and MayaFlux::Yantra::StatisticalAnalyzer< InputType, OutputType >::compute_statistical_values().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: