diff --git a/lib/hooks/dp.cpp b/lib/hooks/dp.cpp index 06df2bb81..4fa3bbd78 100644 --- a/lib/hooks/dp.cpp +++ b/lib/hooks/dp.cpp @@ -43,7 +43,7 @@ protected: void step(double *in, std::complex *out) { int N = window.size(); - __attribute__((unused)) std::complex om_k, corr; + std::complex om_k, corr; double newest = *in; __attribute__((unused)) double oldest = window.update(newest); @@ -122,6 +122,10 @@ public: coeffs[i] = 0; window = dsp::Window((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; }