Optimization of 40 Gbit/s transmission systems using frequency resolved optical gating characterization techniques