summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-10-17 10:49:36 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-10-17 10:49:36 +0200
commit343bdbaa7d3ac2fd6ee3d83c2d8bee5d80c94fda (patch)
tree5f113592014148f8e7f4f7086b433864d8ed4e97
parent0cff7ae12e4672f7b8272830691bfbfe92dd56c3 (diff)
accela: don't check NaNs in filter, wrong place
-rw-r--r--ftnoir_filter_accela/ftnoir_filter_accela.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/ftnoir_filter_accela/ftnoir_filter_accela.cpp b/ftnoir_filter_accela/ftnoir_filter_accela.cpp
index 3e049eb0..ab5fda07 100644
--- a/ftnoir_filter_accela/ftnoir_filter_accela.cpp
+++ b/ftnoir_filter_accela/ftnoir_filter_accela.cpp
@@ -64,13 +64,9 @@ void FTNoIR_Filter::filter(const double* input, double *output)
{
for (int i = 0; i < 6; i++)
{
- const bool drop = std::isnan(input[i]) || std::isinf(input[i]);
- double f = input[i];
- if (drop)
- f = 0;
- output[i] = f;
- last_output[i] = f;
- smoothed_input[i] = f;
+ output[i] = input[i];
+ last_output[i] = input[i];
+ smoothed_input[i] = input[i];
}
first_run = false;
t.start();
@@ -92,9 +88,7 @@ void FTNoIR_Filter::filter(const double* input, double *output)
{
Map& m = i >= 3 ? rot : trans;
- const bool drop = std::isnan(input[i]) || std::isinf(input[i]);
- const double f = drop ? last_output[i] : input[i];
- smoothed_input[i] = smoothed_input[i] * (1.-alpha) + f * alpha;
+ smoothed_input[i] = smoothed_input[i] * (1.-alpha) + input[i] * alpha;
const double in = smoothed_input[i];