Measurement of nonlinear distortion in photodiodes