Minimizing photodiode nonlinearities by compensating voltage-dependent responsivity effects