Hi vdurgaidass,
Im not a uP soul:-(, but if you soluted FFT calculating= you will know, where are the spectral lines & how high is their amplitude... By sinus you have no more as the 50 Hz line, if it will be distorted you becomes everey time more lines_harmonics are coming, lines & amplitudes depend of type the distorting (sawtooth/triangle/square are_distorted sinus too) others sayed signal quality.
Its not simple to calculate, these was reason of my question: can you have it?
If you dont decide to apply FFT (or DFT can be more better for you); maybe you can build/programm digital (band) filter on your uP for 100/200/300Hz and so on and check for your outcoming signal amplitudes...
If you have "sweeped (band)filter" frequency betwen 49 & 51 Hz you dont need more filter for the extrems(49 & 51 Hz), but you check the outgoing amplitudes online= you can check for your distortios too(at the harmonics, and for the concrete frequencies too, then you know your sweeped frequencies controlled/momentan value...
K.
Added after 10 minutes:
A third possibility is to build active band filters for 49,50 &51Hz and measure online (or periodicly) the output amplitudes= you konws the frequency as proportion of the tre signals.
Than much other active filters for the some, application specific for your distortions_or only theoretiacal square version, harmoincs are even to build.
Your "to do" job is "only" to analyze the 5---6 or 7 voltages after all the filter...
K.