We present a lock-in detection scheme, which simultaneously computes the amplitude and phase of several signals using nonsinusoidal references that have odd harmonics only. By stating constraints on the frequencies of the references and on the measurement time, we guarantee perfect discrimination of the sources. Using square-wave references, we simplify the lock-in algorithm, rendering it suitable to an implementation directly in logic. Furthermore, we apply this scheme to the design of a moisture sensor for industrial real-time measurement applications.Index Terms-Digital lock-in detection, least squares regression moisture model, lock-in amplifier, moisture sensor, multifrequency nonsinusoidal lock-in, spectroscopy.