Analysis of Time-Domain Scattering by Periodic Structures