How to view a sleep study (PSG) EDF file
Open the signals, page through in 30-second epochs, and find the sleep stages.
What a sleep study holds
A polysomnogram (PSG) records a whole night, and its EDF file holds more than EEG. Each kind of channel is often recorded at its own rate, which EDF allows: fast for EEG and muscle, slow for breathing and oxygen.
| Channel | What it records |
|---|---|
| EEG, such as F4-M1, C4-M1 and O2-M1 | Brain activity, the basis of sleep stages |
| EOG, left and right | Eye movements, which mark REM sleep |
| Chin EMG | Muscle tone, which falls in REM sleep |
| ECG | The heart |
| Leg EMG | Leg movements |
| Airflow and effort | Breathing at the nose and mouth, and the movement of the chest and abdomen |
| SpO2 | Oxygen saturation, in % |
Open a night in your browser
PhysioNet’s Sleep-EDF Database Expanded is free to download: 197 whole nights, each a PSG file in EDF with a hypnogram file beside it. SC4001E0-PSG.edf, 48 MB, has two EEG channels and one EOG channel at 100 Hz, and breathing, chin muscle, temperature and an event marker at 1 Hz.
Drop the PSG file on the Online EEG Reviewer. Each channel is drawn at its own rate; channels without a voltage unit, such as breathing or temperature, are drawn by their shape. Choose Auto-fit under the scale to size each channel to its own signal; temperature barely changes within a page, so it stays flat.

Recording: PhysioNet Sleep-EDF Database Expanded, SC4001E0 (Kemp et al. 2000), ODC-By 1.0.
Set Window to 30 s: sleep is scored in 30-second epochs, so each page is one epoch. Keep the montage on Original: sleep EEG is often stored as pairs already, such as Fpz-Cz or C4-M1.
Page with ← and →, or type a time such as 8:30:30 to go there. A whole night is long: this one runs 22 hours, and sleep begins 8 hours 30 minutes after the start.
Free shows the first 10 minutes of each recording, so a night needs Pro or Max. The Reviewer and the app show the signals; they do not score sleep stages or detect events.
Where the sleep stages are
The scoring is usually a file of its own. Sleep-EDF keeps it in an EDF+ file with only annotations, such as SC4001EC-Hypnogram.edf, which marks runs of 30-second epochs as Sleep stage W, 1, 2, 3, 4, R or ? (not scored); other nights also mark Movement time. The Online EEG Reviewer opens each file in a tab of its own and needs signals to draw, so it cannot open the hypnogram or lay its stages over the PSG. The National Sleep Research Resource (NSRR) keeps its scoring in XML files beside each EDF.
In Python, MNE-Python reads the two Sleep-EDF files together:
import mne
raw = mne.io.read_raw_edf("SC4001E0-PSG.edf")
stages = mne.read_annotations("SC4001EC-Hypnogram.edf")
raw.set_annotations(stages) # the stages as annotations on the signals
print(raw.annotations.description[:5], raw.annotations.onset[:5])MNE-Python resamples every channel to the highest rate as it reads the file, so the 1 Hz channels come out at 100 Hz. It warns that one stage runs past the end of the recording, and cuts it there.
On iPhone, iPad and Mac
EEG TraceLab opens the same PSG files, each channel at its own rate. Name the recording when you import it, and the app keeps a de-identified copy, which suits clinical sleep files whose header holds a name or a date of birth.
Common problems
SpO2 or breathing has no spectrum
The spectrum is only for channels in a voltage unit, such as µV.
NSRR files need permission
NSRR data are free, but each dataset needs an account and an approved data access request. Its signals are EDF and open like any other.