Miniaturized system and method for measuring optical characteristics