THD calculation using microcontroller
Power supplies are not usefully characterized by THD. THD stands for Total Harmonic Distortion, and DC (the desired power supply output) has no harmonics. 

The closest thing to THD is pk-pk ripple, or perhaps noise (over a specified bandwidth). In neither case is an FFT a useful tool. In the case of ripple, a scope is the preferred tool, and for noise performance an RMS voltmeter works just fine.