Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - MSP430 AD collects two voltage data, how to collect 200 points per second, and then calculate the time corresponding to the two maximum voltage values respectively.
MSP430 AD collects two voltage data, how to collect 200 points per second, and then calculate the time corresponding to the two maximum voltage values respectively.
1, the most direct method is to find the maximum value and the sample serial number corresponding to the maximum value by bubbling method, and divide the two serial numbers by the sampling frequency to get the time difference. However, this method is greatly affected by interference or burr, and its accuracy is low.

2. The time corresponding to the two maximum voltage values can be measured by a simpler and more accurate method. Because for periodic signals, the time difference between the maximum moments of the two signals is equal to the phase difference divided by the frequency.

The phase difference can be obtained by the zero-crossing time of two signals, and the signal is shaped and realized by digital circuit.

3. If it is a complex signal, you can sample it by your method, then calculate the fundamental phase of the two signals by Fourier transform, and then subtract it to get the phase difference.