summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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];