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
)
inline
static
private
Definition at line
462
of file
WaveformAnalyzer.hpp
.
463
{
464
const
auto
fail
= [](
std::string_view
message
) {
465
error<std::invalid_argument>
(
Journal::Component::Yantra
,
Journal::Context::ComputeMatrix
,
466
std::source_location::current
(),
"{}"
,
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
}
476
const
uint32_t
min_lag
=
shortest_lag
(
cfg
);
477
const
uint32_t
max_lag
=
longest_lag
(
cfg
);
478
if
(
min_lag
>=
max_lag
) {
479
fail
(
"The frequency range spans fewer than two lags"
);
480
}
481
if
(
max_lag
>=
std::numeric_limits<uint16_t>::max
()) {
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
}
MayaFlux::Yantra::WaveformAnalyzer::shortest_lag
static uint32_t shortest_lag(const WaveformAnalyzerConfig &cfg)
Definition
WaveformAnalyzer.hpp:452
MayaFlux::Yantra::WaveformAnalyzer::longest_lag
static uint32_t longest_lag(const WaveformAnalyzerConfig &cfg)
Definition
WaveformAnalyzer.hpp:457
MayaFlux::Yantra::WaveformAnalyzer
Time-domain descriptors of every channel, run on the GPU.
Definition
WaveformAnalyzer.hpp:265
MayaFlux
Yantra
WaveformAnalyzer
Generated by
1.15.0