34 #ifndef __INCLUDE_FILTER_FIR_FILTER_H__
35 #define __INCLUDE_FILTER_FIR_FILTER_H__
38 #ifndef __INCLUDE_MIST_H__
42 #ifndef __INCLUDE_MIST_TYPE_TRAIT_H__
43 #include "../config/type_trait.h"
53 namespace __fir_filter__
56 template<
class T,
class Allocator>
58 const array<T, Allocator>& in,
59 array<T, Allocator>& out,
61 const array<T, Allocator>& coef,
63 array<double> buf(order, 0.0);
65 out.resize(in.size());
68 for(
int n = 0; n < in.size(); n ++)
70 for(
int k = 0; k < order - 1; k ++)
72 buf[k] = coef[k] * in[n] + buf[k + 1];
74 buf[order - 1] = coef[order - 1] * in[n];
86 #endif // __INCLUDE_FILTER_FIR_FILTER_H__