This repository has been archived on 2020-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
Files
Indoor/math/dsp/iir/BiQuadStack.h
2018-10-25 11:50:12 +02:00

53 lines
919 B
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* © Copyright 2014 Urheberrechtshinweis
* Alle Rechte vorbehalten / All Rights Reserved
*
* Programmcode ist urheberrechtlich geschuetzt.
* Das Urheberrecht liegt, soweit nicht ausdruecklich anders gekennzeichnet, bei Frank Ebner.
* Keine Verwendung ohne explizite Genehmigung.
* (vgl. § 106 ff UrhG / § 97 UrhG)
*/
#ifndef BIQUADSTACK_H
#define BIQUADSTACK_H
#include <vector>
#include "BiQuad.h"
namespace IIR {
template <typename Scalar> class BiQuadStack {
std::vector<BiQuad<Scalar>> filters;
public:
BiQuadStack() {
;
}
BiQuadStack(const int num) {
filters.resize(num);
}
void resize(const int num) {
filters.resize(num);
}
BiQuad<Scalar>& operator [] (const size_t idx) {
return filters.at(idx);
}
Scalar filter(Scalar val) {
for (BiQuad<Scalar>& bq : filters) {
val = bq.filter(val);
}
return val;
}
};
}
#endif // BIQUADSTACK_H