Ectopic beats are abnormal cardiac beats originating from a location different than the sino-atrial node and therefore not being controlled by the autonomous nervous system. Thus, correct heart rate variability analysis inevitably requires accurate ectopic beat detection. Furthermore, an accurate ectopic beat detection is crucial to differentiate irregular cardiac rhythm due to different types of pathological arrhythmias from those caused by isolated ectopic beats. In this paper, we present an algorithm for ectopic beat detection based on wrist plethysmographic (PPG) signals. The proposed algorithm relies on analyzing the inter-beat patterns while considering the heart-rhythm condition: whether sinus rhythm (SR) or atrial fibrillation (AF). We monitor 29 patients recovering from surgery in the post-anesthesia care unit. During the recordings, 15 patients had SR and 14 patients had AF. The proposed ectopic beat detection algorithm achieves a sensitivity of and a specificity of 2.12.