MayaFlux 0.1.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 70 of file Yantra.cpp.

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

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: