A system for measuring a concentration of a substance in a sample, the system comprising: a light source configured to emit light (850, 852) including one or more wavelengths, wherein the light source is configured to emit light (850, 852) based on one or more first signals from logic; means for splitting the light (850, 852) into a first light that travels along a first light path and a second light that travels along a second light path, the sample being configured to receive a portion of the first light; a reference comprising one or more spectroscopic properties, wherein the reference is configured to receive at least a portion of the second light; a detector configured to detect the portion of the first light and the portion of the second light; the detector being configured to generate one or more second signals (858, 868) indicative of the detected portion of the first light and the detected portion of the second light; a first modulator positioned along the first light path between the light source and the sample; a second modulator positioned along the second light path between the light source and the reference; and logic configured to: send the one or more first signals to the light source; receive the one or more second signals (858, 868) from the detector; and perform a calibration phase, the calibration phase comprising: deactivating the first and second modulators (834, 836) during a first time period, such that the detector receives an unmodulated portion of the first light and an unmodulated portion of the second light; activating the first and second modulators (834, 836) during a second time period, such that the detector receives a modulated portion of the first light and a modulation portion of the second light; and adjusting the light source emission properties based on a comparison of the unmodulated and modulated portions of the first light and the second light. a light source configured to emit light (850, 852) including one or more wavelengths, wherein the light source is configured to emit light (850, 852) based on one or more first signals from logic; means for splitting the light (850, 852) into a first light that travels along a first light path and a second light that travels along a second light path, the sample being configured to receive a portion of the first light; the light source is configured to emit light (850, 852) based on one or more first signals from logic; means for splitting the light (850, 852) into a first light that travels along a first light path and a second light that travels along a second light path, the sample being configured to receive a portion of the first light; a reference comprising one or more spectroscopic properties, wherein the reference is configured to receive at least a portion of the second light; a detector configured to detect the portion of the first light and the portion of the second light; the detector being configured to generate one or more second signals (858, 868) indicative of the detected portion of the first light and the detected portion of the second light; a first modulator positioned along the first light path between the light source and the sample; a second modulator positioned along the second light path between the light source and the reference; and logic configured to: send the one or more first signals to the light source; receive the one or more second signals (858, 868) from the detector; and perform a calibration phase, the calibration phase comprising: deactivating the first and second modulators (834, 836) during a first time period, such that the detector receives an unmodulated portion of the first light and an unmodulated portion of the second light; activating the first and second modulators (834, 836) during a second time period, such that the detector receives a modulated portion of the first light and a modulation portion of the second light; and adjusting the light source emission properties based on a comparison of the unmodulated and modulated portions of the first light and the second light. send the one or more first signals to the light source; receive the one or more second signals (858, 868) from the detector; and perform a calibration phase, the calibration phase comprising: deactivating the first and second modulators (834, 836) during a first time period, such that the detector receives an unmodulated portion of the first light and an unmodulated portion of the second light; activating the first and second modulators (834, 836) during a second time period, such that the detector receives a modulated portion of the first light and a modulation portion of the second light; and adjusting the light source emission properties based on a comparison of the unmodulated and modulated portions of the first light and the second light. deactivating the first and second modulators (834, 836) during a first time period, such that the detector receives an unmodulated portion of the first light and an unmodulated portion of the second light; activating the first and second modulators (834, 836) during a second time period, such that the detector receives a modulated portion of the first light and a modulation portion of the second light; and adjusting the light source emission properties based on a comparison of the unmodulated and modulated portions of the first light and the second light.