Optical Reshaping of 40-Gb/s NRZ and RZ Signals Without Wavelength Conversion