  We present here a technique for developing a high-throughput algorithm to fit
a combination of template pulse shapes while simultaneously subtracting
parameterized background noise. By convolving the psuedoinverse of the
least-squares fit design matrix along a regularly sampled waveform trace, the
time evolution of the fit parameters for each basis function can be determined
in real-time. We approximate these sliding linear fit response functions using
piecewise polynomials, and develop an FPGA-friendly algorithm to be implemented
in high sample-rate data acquisition systems. This is a robust universal filter
that compares well to common filters optimized for energy
calibration/resolution, as well as filters optimized for timing performance,
even when significant noise components are present.
