Figure 10. Single-Tap FIR Filter
The FIR filter does not have unity gain. Its gain would vary depending on the amount of fractional delay. The foreground process compensates for the nonunity gain when the whole block of power samples is calculated.
3.2.6 LED Pulse Generation
In electricity meters, the energy consumed is normally measured in fraction of kilowatt-hour pulses. The meter must accurately generate and record the number of these pulses.
It is a general requirement that these pulses are generated with relatively little jitter. Although the time jitters are not an indication of bad accuracy; as long as the jitters average out, it gives a negative impression on the overall accuracy of the meter.
This application uses the average power to generate the energy pulses. The average power (calculated by the foreground process) is accumulated every Timer_A0 interrupt. This is equivalent to converting the measurement to energy and, once the accumulated energy crosses a threshold, a pulse is generated. The amount of energy above this threshold is kept, and the new energy amount is added in the next interrupt cycle.
Because the average power tends to be a stable value, this method of generating the pulses produces energy pulses that are very steady and free of jitter. The threshold determines the energy "tick" specified by the power company and is a constant. For example, this can be in kilowatt-hour. The Timer_A hardware circuit generates the pulse, which makes it accurate within 1/3276.8 second.