Changeset 223 in flair-src for trunk/lib/FlairFilter/src/LowPassFilter_impl.cpp
- Timestamp:
- 02/27/18 12:20:03 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairFilter/src/LowPassFilter_impl.cpp
r214 r223 67 67 " Hz", 0, 10000, 0.1, 2, 1); 68 68 69 previous_time=GetTime();70 69 this->self = self; 71 70 } … … 87 86 88 87 if (T->Value() == 0) { 89 delta_t = (float)(data->Data Time() - previous_time) / 1000000000.;88 delta_t = (float)(data->DataDeltaTime() ) / 1000000000.; 90 89 } else { 91 90 delta_t = T->Value(); 92 91 } 93 for (int i = 0; i < input->Rows(); i++) { 94 for (int j = 0; j < input->Cols(); j++) { 95 float cutoff=freq->Value(); 96 if (cutoff == 0 || freq->ValueChanged()) { 97 output->SetValueNoMutex(i, j, input->ValueNoMutex(i, j)); 98 } else { 99 output->SetValueNoMutex(i, j, (1 - 2 * PI * cutoff * delta_t) * 100 output->ValueNoMutex(i, j) + 101 2 * PI * cutoff * delta_t * 102 input->ValueNoMutex(i, j)); 92 93 if(delta_t!=0) { 94 for (int i = 0; i < input->Rows(); i++) { 95 for (int j = 0; j < input->Cols(); j++) { 96 float cutoff=freq->Value(); 97 if (cutoff == 0 || freq->ValueChanged()) { 98 output->SetValueNoMutex(i, j, input->ValueNoMutex(i, j)); 99 } else { 100 output->SetValueNoMutex(i, j, (1 - 2 * PI * cutoff * delta_t) * 101 output->ValueNoMutex(i, j) + 102 2 * PI * cutoff * delta_t * 103 input->ValueNoMutex(i, j)); 104 } 103 105 } 104 106 } … … 109 111 110 112 output->SetDataTime(data->DataTime()); 111 previous_time = data->DataTime();112 113 }
Note:
See TracChangeset
for help on using the changeset viewer.