Wave Propagation in Discontinuous Media by the Scattering Matrix Method