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

◆ validate_config()

template<ComputeData InputType = std::vector<Kakshya::DataVariant>, ComputeData OutputType = Eigen::MatrixXd>
void MayaFlux::Yantra::WaveformAnalyzer< InputType, OutputType >::validate_config ( const WaveformAnalyzerConfig & cfg)
inlinestaticprivate

Definition at line 462 of file WaveformAnalyzer.hpp.

463 {
464 const auto fail = [](std::string_view message) {
467 };
468 if (!std::isfinite(cfg.sample_rate) || cfg.sample_rate <= 0.0) {
469 fail("Sample rate must be finite and greater than 0");
470 }
471 if (!std::isfinite(cfg.low_frequency) || !std::isfinite(cfg.high_frequency)
472 || cfg.low_frequency <= 0.0 || cfg.high_frequency <= cfg.low_frequency
473 || cfg.high_frequency >= cfg.sample_rate / 2.0) {
474 fail("Frequencies must satisfy 0 < low < high < sample rate / 2");
475 }
478 if (min_lag >= max_lag) {
479 fail("The frequency range spans fewer than two lags");
480 }
482 fail("The longest period is too long to search");
483 }
484 if (cfg.window_size < 2U * max_lag) {
485 fail("The window must hold at least twice the longest period");
486 }
487 if (cfg.hop_size == 0) {
488 fail("The hop size must be greater than 0");
489 }
490 if (cfg.native_float && cfg.keep_profiles) {
491 fail("Profiles are kept only by the double passes, not with native_float");
492 }
493 }
static uint32_t shortest_lag(const WaveformAnalyzerConfig &cfg)
static uint32_t longest_lag(const WaveformAnalyzerConfig &cfg)
Time-domain descriptors of every channel, run on the GPU.