Compensated attenuator