The estimation of sleep quality in different stages and cycles of sleep