-
Notifications
You must be signed in to change notification settings - Fork 264
Open
Description
I noticed that there is no fir filter equivalent to this one from matlab. I think it would be nice and useful. Here is a c++ equivalent i made and it may be somewhat useful. I know its far from optimized.
kfr::univector<double> filter1d(const kfr::univector<double>& b,const kfr::univector<double>& x) {
const auto filter_length = b.size();
const auto seg_length = x.size();
kfr::univector filtered(seg_length, 0.0);
for (auto n = 0; n < seg_length; n++) {
for (auto k = 0; k < filter_length; k++) {
if (n >= k)
filtered[n] += b[k] * x[n - k];
}
}
return filtered;
}Metadata
Metadata
Assignees
Labels
No labels