Spectra of perturbations produced by double inflation with an intermediate matter-dominated stage