A method and apparatus utilizing a piecewise stitching adaptive algorithm (PSAA) to filter signal artifacts, such as those induced by cardiopulmonary resuscitation (CPR) from sensed signals in real-time. PSAA is a method of estimating artifact component present in a first signal that is highly correlated with a second signal. The PSAA may utilize autocorrelation and cross-correlation calculations to determine signal sample windows in the first and second signals. The PSAA may estimate a signal artifact in a primary signal segment based on the determined correlations between the primary signal and an artifact signal. The PSAA may remove the estimated signal artifact from the primary signal. In the absence of an artifact signal, PSAA is able to estimate artifacts in the first signal utilizing filters. The PSAA may be implemented in Automated External Defibrillators, Monitor Defibrillators or other devices capable sensing highly correlated signals such as, for example, ECG and CPR signals.