Apply a Discrete Fourier Transform (DFT) at the exact test frequency. This rejects noise and harmonics.
But what if you could build one with for the cost of a pizza? Create A Low-Cost- High-Accuracy LCR Meter With An STM32 MCU
Trigger ADC with a timer at, say, 64× the sine frequency. Use dual regular+injected mode to sample two channels with known delay. Apply a Discrete Fourier Transform (DFT) at the