Various examples are described for detecting heart rate and respiratory rate by using measurements of light applied to skin through an article. For example, a sensor application obtains a set of measurements of light. The application compensates for a contribution of the article based on one or more known optical properties of the article. The sensor application further determines, from the set of measurements of light, a periodic change in amplitude. The sensor application identifies the periodic change in amplitude as a heart rate having an identical periodicity. The sensor application identifies a respiratory rate as equal to the rate of change of the heart rate.