Polysomnography (PSG), commonly known as a sleep study, is a comprehensive test used to diagnose sleep disorders. It records various physiological parameters during sleep, including brain waves, blood oxygen levels, heart rate, breathing, and eye and leg movements.