# Sampling and zero crossing

I am sampling a sine wave of 50Hz(stepped down from 230V) at the rate of 500KHz. For identifying disturbances in the wave, i was thinking of comparing a cycle of incoming sine values with reference sine values(pure sine wave). But will the method be accurate? one of my friends told that there will be loss of synchronization and so number of samples in one cycle wont be the same every time we measure and comparison will give wrong answer. If so, could anyone suggest some method for doing the same? Also,how to detect the zero crossing point without using any hardware?

• What about a frequency domain analysis ? If your signal is disturbed (=has parasitic components) the spectrum will show several frequency components other than 50 Hz. To find the zeros, it can be done with any numerical computation software (like matlab) Feb 29, 2016 at 12:22
• Your concern on the accurate phase-match of an ideal (mathematically generated) sine wave with an incoming real (physically generated) sine wave is quite correct and MaximGi already offerred an achievable solution to ease your more main concern of detecting distortions on it. Then be also aware that there are methods to lock those two sines as used in many communications equipment where an accurate enough phase-lock is necessary to demodulate the incoming message. So your otherwise solution could look into a digital pll implementation. But that name is already horrifying. Feb 29, 2016 at 14:13
• i guess i will have to go with the digital pll then. Could you kindly detail on how it works and the problems (if any)associated with using it. And also where i can find example codes for it.
– vvv
Mar 1, 2016 at 5:04