Influence of the potential barrier switching frequency on the effectiveness of energy harvesting