I've got a Knowles SPH1642HT5H-1 (pdf link) analog MEMS microphone that I'm planning to connect to one of the ADC inputs on an STM32. I've done what I think are the correct calculations to determine the gain and offset that I will require but would like someone to just check that my interpretation of the datasheet is correct.
The sensitivity of the microphone is -38dbV/Pa and the MCU AVDD is 3.3V. The small signal is carried on a relatively large DC offset. I calculate for the signal:
$$ Vrms = 10^{-38/20} = 12.589mV\\\\ Vpp = Vrms . \sqrt{2} = \pm 17.8mV\\\\ Gain = \frac{AVDD}{2 . Vpp} = 92\\\\ Offset = \frac{AVDD}{2} = 1650 $$
To make full use of the range of the single-ended ADC I need to design a pre-amp with a gain of 92 and an offset of 1650mV.
For reference, these are the datasheet parameters:
Edit
Based on the @JRE's comments below I can recalculate as follows.
If I want 70dB SPL to be full scale on the ADC then, using this calculator I convert dB SPL to Pa and get 0.0632Pa. The new gain calculation will be:
$$ Gain = \frac{\frac{0.5 . AVDD}{\sqrt{2}}}{10^{-38/20}. 0.0632} = 1466 $$
Based on @Andy aka's answer I can adjust further based on how things actually perform in the real world.