Apparatus, including a current source which has a transformer having a primary winding coupled to receive input power. The transformer has a secondary winding having a first plurality of secondary taps configured to supply electrical power at an ablation frequency to an electrode in contact with body tissue. The issue has an impedance, and is ablated by the electrical power. The current source has a second plurality of capacitors. The apparatus also includes a controller which is configured to select one of the secondary taps and at least one of the capacitors in response to the impedance and the ablation frequency, and to connect the selected secondary tap to the selected at least one of the capacitors.