Cyclic Alternating Pattern (CAP) Occurs during Non-Rapid Eye Movement (NREM) Sleep and Is Exploited as a Neuro-Marker of Various Sleep Disorders. the CAP Is Build up from so Called a and B Phases Which Correspond to Widespread Synchronous and Regular Background Activities of EEG Respectively. Currently, These Phases Are Detected by Medical Experts through Visual Inspection, Thereby Limiting Their Potential to Be Used as a Gauge for Sleep Quality. This Paper Aims to Contribute to the Current Effort towards Automatic Detection of CAP Phases, so That Its Potential Can Be Improved in the Assessment of Sleep Quality. unlike Previous Research Where a Predefined Bipolar (and/or Monopolar) Channel Was Used for Automatic Detection, This Paper Explores the Use of a Two-Step Principal Component Analysis (PCA) in Spatial and Feature Domains to Extract Features from All 21 Recording Channels of Ambulatory EEG. Linear Discriminant Analysis (LDA) Was Used on the Extracted Features to Discriminate Phase a and B. over a Five Subject Database, Our Algorithm Reached an Average Classification Accuracy over 86%, Whereas the Baseline Approach Resulted in an 80.3% Success Rate. These Results Indicate That the Two Step PCA Procedure Can Be Used Effectively to Extract Features from Ambulatory EEG towards Detection of CAP.