1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

dp hook: make it an error when window size is 0

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
This commit is contained in:
Niklas Eiling 2024-06-28 09:16:37 +02:00 committed by Niklas Eiling
parent 136d033cd3
commit 64058be78f

View file

@ -43,7 +43,7 @@ protected:
void step(double *in, std::complex<float> *out) {
int N = window.size();
__attribute__((unused)) std::complex<double> om_k, corr;
std::complex<double> om_k, corr;
double newest = *in;
__attribute__((unused)) double oldest = window.update(newest);
@ -122,6 +122,10 @@ public:
coeffs[i] = 0;
window = dsp::Window<double>((1.0 / f0) / timestep, 0.0);
if (window.size() == 0) {
throw RuntimeError(
"Windows size is 0: f0 * timestep < 1.0 not satisfied");
}
state = State::STARTED;
}