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:
parent
136d033cd3
commit
64058be78f
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue