Cleaner ADC measurements which of these ways is better

alexmg2:
Currently I have whole system (Atmega328p on PCB) powered by Switching regulator that provides 3.4V with stable ripple of 40mV at about 5Khz.

5kHz, 40mV...
Is this a DIY switching regulator.
Modern micropower switching regulators work between 500kHz and 2Mhz.
Much easier to filter that with an LC circuit.
Leo..