Critical-angle measurement of refractive index of absorbing materials: an experimental study