Ignore:
Timestamp:
02/27/18 12:20:03 (6 years ago)
Author:
Sanahuja Guillaume
Message:

add delta time to io_data

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairFilter/src/LowPassFilter_impl.cpp

    r214 r223  
    6767                           " Hz", 0, 10000, 0.1, 2, 1);
    6868                           
    69   previous_time=GetTime();
    7069  this->self = self;
    7170}
     
    8786
    8887  if (T->Value() == 0) {
    89     delta_t = (float)(data->DataTime() - previous_time) / 1000000000.;
     88    delta_t = (float)(data->DataDeltaTime() ) / 1000000000.;
    9089  } else {
    9190    delta_t = T->Value();
    9291  }
    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        }
    103105      }
    104106    }
     
    109111
    110112  output->SetDataTime(data->DataTime());
    111   previous_time = data->DataTime();
    112113}
Note: See TracChangeset for help on using the changeset viewer.