THD vs. S/N+D
These things get confused so I'd like to offer two tips to help you understand the difference.
The first thing to understand is that they are defined not just by what we'd like to know, but the limitations of measurements.
Signal to Noise plus Distortion is an attempt to understand how much of the output is intended, vs. not. It's calculated by subtracting the output (perhaps with some reduction in level) versus the input. Any remaining signal there is "unintended."
Another way to write this may be: Signal / (noise + distortion)
N+D is in parenthesis because we can't tell by this measurement what is the result of noise, and what is non-linear amplification of the intended signal. It is often misread as: ( Signal/Noise ) + Distortion.
Total Harmonic Distortion is measured differently. Here we attempt to know about the amount of harmonics of the signal, which are multiples of the input frequency. These are usually (but not always) unintended by-products of amplification, and by amplification this includes gain less than or equal to 1. This is often measured using a notch filter (very narrow, deep) of the fundamental which leaves the harmonics, but I defer to the Wikipedia article here for the math:
https://en.wikipedia.org/wiki/Total_harmonic_distortionWhile these are standard and important measurements, I want to point out that they have been around since the 1960's if not earlier, and that despite computer and DSP processing progressing greatly these measurements have not, so we should not get to complacent in believing that this is all that can or should be measured.
I look forward to hardware makers and EE readers to expand and correct me in constructive manners below.
Best,
E