Interior penalty discontinuous galerkin methods for electromagnetic and acoustic wave equations