mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-21 15:51:47 -05:00
M17: IirFilter code cleanup
This commit is contained in:
parent
06a0f051e9
commit
820a5dc992
@ -13,12 +13,9 @@ namespace modemm17
|
||||
template <size_t N>
|
||||
struct BaseIirFilter : FilterBase<float>
|
||||
{
|
||||
const std::array<float, N>& numerator_;
|
||||
const std::array<float, N> denominator_;
|
||||
std::array<float, N> history_{0};
|
||||
|
||||
BaseIirFilter(const std::array<float, N>& b, const std::array<float, N>& a)
|
||||
: numerator_(b), denominator_(a)
|
||||
BaseIirFilter(const std::array<float, N>& b, const std::array<float, N>& a) :
|
||||
numerator_(b),
|
||||
denominator_(a)
|
||||
{
|
||||
history_.fill(0.0);
|
||||
}
|
||||
@ -40,11 +37,15 @@ struct BaseIirFilter : FilterBase<float>
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private:
|
||||
const std::array<float, N>& numerator_;
|
||||
const std::array<float, N> denominator_;
|
||||
std::array<float, N> history_{0};
|
||||
};
|
||||
|
||||
template <size_t N>
|
||||
BaseIirFilter<N> makeIirFilter(
|
||||
const std::array<float, N>& b, const std::array<float, N>& a)
|
||||
BaseIirFilter<N> makeIirFilter(const std::array<float, N>& b, const std::array<float, N>& a)
|
||||
{
|
||||
return std::move(BaseIirFilter<N>(b, a));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user