Optical Signal Processing and Switching with Second-Order Nonlinearities in Waveguides