0
$\begingroup$

I am studying methods of signal smoothing obtained in an Analog Digital converter that is operated by a common potentiometer that generates a certain noise, such potentiometer is linear and I cannot change it to a logarithm.

The intention would be similar to converting a trapezoidal wave to a sine wave.

Below I present a graph with the curve I get today using a Single Exponential Smoothing

enter image description here

I even tried it with Double Exponencial Smoothing but I still haven't got the formula right when coding it.

#elif SMOOTHING_TYPE == SMOOTHING_SINGLE
  smoothing_low[index]  = (alfa_low  * value) + ((1 - alfa_low) * smoothing_low[index]);
  smoothing_high[index] = (alfa_high * value) + ((1 - alfa_high) * smoothing_high[index]);
#elif SMOOTHING_TYPE == SMOOTHING_DOUBLE
  uint16_t smoothing_low_old = smoothing_low[index];
  smoothing_low[index] = (alfa_low * value) 
                  + ((1 - alfa_low) * (smoothing_low[index] - smoothing_y_low[index]));
  smoothing_y_low[index] = upsilon_low * (smoothing_low[index] - smoothing_low_old) 
                  + ((1 - upsilon_low) * smoothing_y_low[index]);

  uint16_t smoothing_high_old = smoothing_high[index];
  smoothing_high[index] = (alfa_low * value) 
                  + ((1 - alfa_low) * smoothing_high[index] - smoothing_y_low[index]);
  smoothing_y_high[index] = upsilon_high * (smoothing_high[index] - smoothing_high_old) 
                  + ((1 - upsilon_high) * smoothing_y_high[index]);
#endif
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.