You could use a true "online" UPS (for servers, not PC's) such as Liebert GXT2-1000's. You can find them on eBay with new batteries for around $200-300 (new about $1000). Note: you should replace the batteries every 3-4 years (or avoid the hazzle and buy a new unit).
There are three types of UPS: offline, line interactive, and online. Offline and line interactive will allow trash thru from the utility (unless complete outage), and do make jagged / squared sine waves.
HOWEVER, online models will reconstructed a purified waveform (without need of further filtering). Also called double-conversion, it creates a true sine wave at output. I use Liebert GXT units on my audio (Canary amp, Envoy pre, Marantz SA-1, ...), and they work great. Sound is pure, better than utility. I never hear any noise, not even during a power failure.