Optimal Linear Controller Design for Periodic Inputs