Tunisia coach Sami Trabelsi has resigned after his side failed to progress from the group stages of the African Cup of Nations.