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

◆ mean_combined()

MAYAFLUX_API double MayaFlux::mean_combined ( const std::vector< Kakshya::DataVariant > &  channels)

Calculate mean across all channels (mix then analyze)

Parameters
channelsVector of channel data
Returns
Single mean value across all mixed channels

Definition at line 72 of file Yantra.cpp.

73{
74 auto data = Yantra::OperationHelper::extract_numeric_data(channels);
75 if (is_same_size(data)) {
76 auto result = mean_per_channel(channels);
77 return std::accumulate(result.begin(), result.end(), 0.0) / result.size();
78 } else {
79 auto mixed = concat_vectors(data);
80 return mean(mixed);
81 }
82}
std::vector< double > mean_per_channel(const std::vector< Kakshya::DataVariant > &data)
Calculate mean per channel for multi-channel data.
Definition Yantra.cpp:57
static bool is_same_size(const std::vector< std::span< double > > &data)
Definition Yantra.cpp:14

References concat_vectors(), MayaFlux::Yantra::OperationHelper::extract_numeric_data(), is_same_size(), mean(), and mean_per_channel().

+ Here is the call graph for this function: