# HG changeset patch # User Ulf.Hammarqvist@gmail.com # Date 1333792324 0 # Node ID 20de0b60b694e329d24ce4e122a1d094d63ff834 # Parent af4bc33b2e1ce32fac1bf0cf81552dbfb7877553 Added the initialization of g0, but parting from the MATLAB way of doing it. (temporary measure) diff -r af4bc33b2e1c -r 20de0b60b694 src/CAR.cpp --- a/src/CAR.cpp Sat Apr 07 09:41:39 2012 +0000 +++ b/src/CAR.cpp Sat Apr 07 09:52:04 2012 +0000 @@ -37,7 +37,11 @@ h_coeffs_[i] = c0_coeffs_[i] * f; - g0_coeffs_[i] = 0; // TODO: matlab design a bit hacky - think for bit + //TODO: g0_coeffs_ calculated here for now. Let's talk about this, need + // to see the whole picture of what makes sense. + // Related: I believe CAR, IHC and AGC classes would be beneficial! + float tmp = 1 - 2*r1_coeffs_[i]*a0_coeffs_[i] + r1_coeffs_[i]*r1_coeffs_[i]; + g0_coeffs_[i] = tmp / ( tmp + h_coeffs_[i]*r1_coeffs_[i]*c0_coeffs_[i]); } }