Active filter for reactive power and harmonics compensation