Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/29/06 12:27
Read: times


 
#128659 - confusion..
Responding to: ???'s previous message
//Apply filter for DC offset removal.

//y[n] =(0.996 * y[n-1]) + (0.996 * x[n]) - (0.996 * x[n-1])
//y[n] = (0.996 * prv fltrd ) + (0.996 * fresh adc) - (0.996 * old adc)

Sample.PreviousFiltered = Sample.Filtered; // y[n] <- y[n-1]
TempL = 255 * (long)Sample.Filtered; TempL = TempL >> 8;
TempI = Sample.Fresh - Sample.Previous;
TempL = TempL + (255 * (long)TempI;)
Sample.Filtered = TempL;

//--------------------------------------

can anybody tell me why (long) is written before sample.filtered even it is declared as long in global decaration.




List of 6 messages in thread
TopicAuthorDate
filter for DC offset removal            01/01/70 00:00      
   I think its already done            01/01/70 00:00      
   Some hints            01/01/70 00:00      
      confusion..            01/01/70 00:00      
         Do you need real time?            01/01/70 00:00      
         how this removes DC offset?            01/01/70 00:00      

Back to Subject List