In this paper, we propose an every other sample-based iteration algorithm for getting electric powers of direct current and alternative current, the method is used to measure electric powers of DC and AC whose frequencies are specified. This algorithm takes aim at a mathematical model of non-sinusoidal signals which are made up of DC component and AC components, we at first calculate the DC component and AC components of voltage and current signals respectively, then computing the electric powers of each part. Through simulating by MATLAB, this measurement has been proved to be fast and accurate. On the other hand, the effect on tracking accuracy caused by the size of bandwidth parameter has also been revealed, the quickness of power tracking can be improved by adjusting the size of this bandwidth.