I came up with an idea to detect, and know what % of distortion is detected, it was something I have been thinking about. Since different amps of different sizes will be used, I could use a voltage regulator(buck) that pulls the fundamental comming in, down to a specific voltage(say 3V) and compare it with a refrence voltage that is a fraction to the fundamental(pertaining to the distortion % I want). I have LM2576t adj simple switcher device but i don't know if it works with an AC input, do you know if it does?