# HG changeset patch # User Ulf.Hammarqvist@gmail.com # Date 1333792324 0 # Node ID e0b20fbd7384927f7ff87cd400449a9945f0dfd1 # Parent c23860d91135bd21aa55ff0f346c28a6db98b547 Added the initialization of g0, but parting from the MATLAB way of doing it. (temporary measure) diff -r c23860d91135 -r e0b20fbd7384 branches/carfac_cpp/src/CAR.cpp --- a/branches/carfac_cpp/src/CAR.cpp Sat Apr 07 09:41:39 2012 +0000 +++ b/branches/carfac_cpp/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]); } }