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

◆ rms_combined()

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

Calculate RMS energy across all channels (mix then analyze)

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

Definition at line 142 of file Yantra.cpp.

143{
144 auto data = Yantra::OperationHelper::extract_numeric_data(channels);
145 if (is_same_size(data)) {
146 auto result = rms_per_channel(channels);
147 double sum_squares = 0.0;
148 for (double v : result)
149 sum_squares += v * v;
150 return std::sqrt(sum_squares / (double)result.size());
151 }
152 auto mixed = concat_vectors(data);
153 return rms(mixed);
154}
std::vector< double > rms_per_channel(const std::vector< Kakshya::DataVariant > &channels)
Calculate RMS energy per channel for multi-channel data.
Definition Yantra.cpp:124

References MayaFlux::Yantra::OperationHelper::extract_numeric_data(), rms(), and rms_per_channel().

+ Here is the call graph for this function: