The test is usually conducted overnight in a sleep lab. Various sensors are attached to the patient's body to monitor different physiological activities. The data is then analyzed by a sleep specialist to diagnose any sleep disorders. In some cases, home-based PSG tests are also available.