PHPFiwa source code can be found here: PHPFiwa.php
The fixed interval with averaging feed engine within emoncms is an extention of the fixed interval engine but instead of one high resolution data layer it produces several additional layers that are lower resolution averages. For example: A time series feed that has a base interval of 10 seconds may then have a 60s average layer, a 10 minute average layer and an hour average layer.
Calculating average layers on the fly like this provides several advantages:
If you want 800 datapoints over a month time period you could read directly from the hour layer and rather than being a random datapoint in the base layer the hour layer value will be representative of the hour it represents.
The main disadvantage is that the additional layers require additional disk writes which reduces the write performance.