Accurate carrier-type determination of nonhomogenously doped diamond