The fundamental frequency of 220V commercial power is 50Hz, with the largest amplitude, and other high-frequency components have smaller amplitudes, all of which are superimposed on the fundamental frequency of 50Hz.
Therefore, it is relatively simple to measure the frequency of 50Hz fundamental frequency. The voltage comparator compares to get a square wave, and the single chip microcomputer measures the frequency of the square wave. As for the amplitude, the stepped-down commercial power is measured by ADC, and then the original voltage is calculated according to the step-down ratio.
In fact, the measurement of 50Hz component can be completed by ADC, which is the knowledge of software, and the period and amplitude of signal can be calculated by software.
To analyze signals of other frequencies, the fundamental frequency of 50Hz should be filtered out first. Because the common step-down method also reduces the amplitude of other harmonic components to an unmeasurable degree, it is necessary to use a filter to filter out the 50Hz signal, and then use ADC to sample the remaining signal and perform FFT operation to obtain the frequency value and amplitude of each frequency component.