mirror of
https://github.com/TomHarte/CLK.git
synced 2026-04-26 19:17:52 +00:00
Entrust the FilterGenerator.
This commit is contained in:
@@ -122,11 +122,24 @@ public:
|
||||
CoefficientType operator[](const size_t index) const {
|
||||
return coefficients_[index];
|
||||
}
|
||||
CoefficientType &operator[](const size_t index) {
|
||||
return coefficients_[index];
|
||||
}
|
||||
|
||||
size_t size() const {
|
||||
return coefficients_.size();
|
||||
}
|
||||
|
||||
using iterator = std::vector<CoefficientType>::iterator;
|
||||
|
||||
iterator begin() {
|
||||
return coefficients_.begin();
|
||||
}
|
||||
|
||||
iterator end() {
|
||||
return coefficients_.end();
|
||||
}
|
||||
|
||||
template <typename IteratorT>
|
||||
void copy_to(
|
||||
IteratorT begin,
|
||||
@@ -161,15 +174,16 @@ public:
|
||||
});
|
||||
}
|
||||
|
||||
FIRFilter &operator *(const CoefficientType rhs) {
|
||||
for(auto &coefficient: coefficients_) {
|
||||
FIRFilter operator *(const CoefficientType rhs) {
|
||||
auto copy = *this;
|
||||
for(auto &coefficient: copy.coefficients_) {
|
||||
if constexpr (type == ScalarType::Float) {
|
||||
coefficient *= rhs;
|
||||
} else {
|
||||
coefficient = (coefficient * rhs) >> FixedShift;
|
||||
}
|
||||
}
|
||||
return *this;
|
||||
return copy;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user