데이타를 평활화 하기위한 함수 입니다.
0 < Coefficient < 1 로 설정하시면 됩니다.
void __fastcall Exponential_Smoothing(double* Data, double Coefficient, int Length)
{
double temp ;
for(int loop=1 ; loop<Length ; loop++)
{
temp = (Data[loop] * Coefficient) + ((1-Coefficient) * Data[loop-1]) ;
Data[loop] = temp ;
}
}
|