Time-harmonic scattering by locally perturbed periodic structures with Dirichlet and Neumann boundary conditions | Synapse