//The inverse of a diagonal matrix is obtained by replacing each element in the diagonal with //its reciprocal.
//A square root of a diagonal matrix is given by the diagonal matrix, whose diagonal entries are //just the square
//roots of the original matrix.
//printf ("This linear preprocessing is line %d.\n", __LINE__);
//The inverse of a diagonal matrix is obtained by replacing each element in the diagonal with //its reciprocal. A square root of a diagonal matrix is given by the diagonal matrix, whose //diagonal entries are just the square roots of the original matrix. However, if SNR is high,
//the diagonal elements of D are very small, and inverse is not always possible. We thus appy a threshold to avoid too low values.