In order to fulfill the grid codes and meet power quality requirements in grid connected converters without increasing the switching frequency or system size, higher order line filters are used. This paper considers the active damping of LCL filters in grid connected converters. The proportional feedback of the last two samples of the filter capacitor current for the purpose of active damping is analyzed in the discrete time domain. A simple numerical design algorithm is proposed and an analytical solution is derived for a special case. The new algorithm allows the optimal active damping of the uncontrolled system or the closed loop system with a grid current or inverter current PI-controller. Finally the performance of the proposed methods is shown and compared through analysis in the z-domain and experimental investigation.