I am attempting to convert the Fourier transform of a Pearson correlation from C++ to Python. However, I'm failing to understand the smoothing technique used.
The 2D array R is initialised as shown below. The array is then assigned the smoothed values of the transformed correlation values, SqSum.
double[,] R = new double[70,2];
for(int Period = 8; Period <= 48; Period++)
{
R[Period, 1] = R[Period, 0];
R[Period, 0] = 0.2 * SqSum[Period] * SqSum[Period] + 0.8 * R[Period,1];
}
How is this smoothing being performed? If on every iteration of the for loop, R[Period, 1] is being assigned the value of R[Period, 0], which I assume to be 0, should R[Period, 0] just become 0.2 * SqSum[Period] * SqSum[Period]?
Sorry if this is a basic question but any help in my understanding is appreciated, cheers.