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

◆ spectral_centroid() [1/2]

MAYAFLUX_API double MayaFlux::spectral_centroid ( const Kakshya::DataVariant data,
double  sample_rate 
)

Definition at line 452 of file Yantra.cpp.

453{
454 auto a = std::make_shared<Yantra::StandardEnergyAnalyzer>();
455 a->set_energy_method(Yantra::EnergyMethod::SPECTRAL);
456 a->set_parameter("sample_rate", sample_rate);
457 auto result = a->analyze_energy({ data });
458 return result.channels.empty() ? 0.0 : result.channels[0].mean_energy;
459}
size_t a

References a, and MayaFlux::Yantra::SPECTRAL.