I use transfer matrix method. I try to plot the phase Φ(ω) versus frequency ω graph in the vicinity of a band gap. The transmission coefficient t(ω) is t(ω) = |t(ω)|*exp(i*Φ(ω)) from which I get the transmission phase Φ(ω) = atan(t_imaginary(ω)/t_real(ω)). Since I assume that -pi/2 ≦ Φ ≦ pi/2, I get negative phase angles in my plot. And since effective index neff(ω) = c/L/ω*Φ(ω) where L is the photonic crystal length, I get neff < 0 which should be positive. I have done calculations by assuming 0 ≦ Φ ≦ 2*pi but the results do not seem to be correct. Appreciate much if someone can point me to the correct way of calculating Φ(ω). Thanks!