Role of brain waves in sleep cycles