title: How to calculate the value of the smoothing parameter for lowpass filter (in case of smoothing of compass sensor data)
body: <p>I want to smooth the compass sensor data of a smartphone using the low pass filter and want to calculate the smoothing parameter for the low pass filter implementation.</p>
  
  <p>I have a question concerning one of the question/post available <a href="https://stackoverflow.com/questions/14113058/compass-readings-on-sgs-iii">on this forum</a></p>
  
  <p>In the above post, author wants to smooth the sensor data using low pass filter and suggested to set the smoothing parameter (ALPHA) according to the needs. The smoothing parameter should lie between 0-1. The value near to 0 is smooth in the data.</p>
  
  <p>Therefore, the author used the ALPHA = 0.15. </p>
  
  <p>According to my opinion and scientifically one can not do this by closing the eyes and picking a random value from 0 to 1. </p>
  
  <p>So my question is how to calculate the smoothing parameter (ALPHA), while my sampling rate is 100Hz. According to my opinion this smoothing parameter is different for different sampling rate. Therefore the guess or analysis of the smoothing parameter will not work in real time.</p>
  
  <p>Therefore, I am looking for how to calculate the smoothing parameter for low pass filter. In this regard, I have seen this <a href="http://web.mit.edu/scolton/www/filter.pdf" rel="nofollow noreferrer">interesting presentation</a></p>
  
  <p>On page 13 one can see the formula to calculate the smoothing parameter if one know the Time constant(Tau)</p>
  
  <p>The formula to calculate the Tau= Capacitance * Resistance</p>
  
  <p>from the data sheet of the electronics compass AK8974, I have calculated the Resistance and capacitance and calculated the (Tau)</p>
  
  <p>knowing the Tau let easily calculation of the smoothing parameter using the following formula </p>
  
  <p>ALPHA=Tau/Tau+deltaT</p>
  
  <p>The value of ALPHA in my case is (0.00714)</p>
  
  <p>I want opinions about the calculation of the time constant (Tau) and smoothing parameter. Is this the correct way to do justify the smoothing parameter? Is there any other way?</p>