xpress_embedo
Advanced Member level 4
- Joined
- Jul 5, 2011
- Messages
- 1,154
- Helped
- 161
- Reputation
- 396
- Reaction score
- 189
- Trophy points
- 1,353
- Location
- India
- Activity points
- 10,591
Hello!!
I am reading a code for measuring ADC data, and found something strange.
Normally we take multiple readings and then take average of all these readings, but in this code, they have taken squared sums.
The Code is something like this:-
where LENGTH is length of the ADC_Data array.
I take dummy values and check it in excel to verify the code, the results are almost identical.
But i want to know why this method, why not normal average method is used.
I am reading a code for measuring ADC data, and found something strange.
Normally we take multiple readings and then take average of all these readings, but in this code, they have taken squared sums.
The Code is something like this:-
Code C - [expand] 1 2 3 4 5 6 for(i=0;i<LENGTH;i++) { value += ADC_Data[i]*ADC_Data[i]; } value = ADC_Data/LENGTH; value = sqrt(value);
where LENGTH is length of the ADC_Data array.
I take dummy values and check it in excel to verify the code, the results are almost identical.
But i want to know why this method, why not normal average method is used.