Complete characterization of ultrafast optical fields by phase-preserving nonlinear autocorrelation