It might interest you to know "Double Conversion" UPS systems like the APC SURTA line are used for computer racks or sensitive equipment to clean up AC power - either grid or generator. Even grid power can be fairly crappy with distorted waveforms, or bad power factor (current leads or lags the AC waveform peaks) or there are transient spikes, etc. Its not really what the power company is putting out, it's what the power has to go by before it gets to you.
The way they work is to convert all the incoming AC power to DC, then they convert it back to AC that has a smooth waveform at the proper voltage. And in the process save some of that DC power to it's batteries that can be tapped if the power grid goes down.