How to detect Premature ventricular contractions (PVCs) in a ECG-signal
I'm an audio guy and not a biomed guy, but if the ECG is decently periodic except for an occasional artifact or anomaly like a PVC, you can do "pitch detection" (estimating the period or fundamental frequency) of the waveform and tune a comb filter to null out the periodic component.  Then the anomalies will be the only thing left after subtracting or nulling out the periodic component.

Then you can perhaps have a dictionary of waveshapes for possible anolamies and cross-correlate (sliding correlation) each of the waveshapes against this remaining waveform.  That operation is, essentially, what we call a "matched filter", which is used to recognize "grains" of signals.