Response of periodic structures by modal analysis