Complex coherence

I am using TerraSAR-X PolInSAR image pair and I want to extract the complex coherence values. I have generated the s2 matrices of the master and the slave images after calibration and from it I have formed the T6 coherency matrix. But, when I am trying to extract the complex coherence values from the T6 matrix for HH+VV, HH-VV, HV+VH polarizations, I am getting the resulting pixel values as NaN/Inf. Can anybody please tell me the correct procedure?