How do you find the phase between two waves?
The phase shift equation is ps = 360 * td / p, where ps is the phase shift in degrees, td is the time difference between waves and p is the wave period.
Which one is best sine wave or square wave?
Sine wave inverters are more efficient than square wave inverters, when it comes to the conversion of DC to AC. This ensures that the power loss is minimised, due to greater efficiency. As a consequence, your electricity bill does not shoot up. This is an immediate benefit of using a sine wave inverter.
How to detect the phase of a sine wave?
(Whether those details are useful or not, I’ll leave for you and the OP to judge.) If you know your signal is a pure sine wave, you can just use zero crossing detection. Each cycle of the sine wave will have two zero crossings: one from negative to positive, and one from positive to negative.
How is the phase shift between two wavefroms calculated?
The difference between the two timer snapshots tells you the time between the zero crossings. The difference between the zero crossing of the same signal tells you the period. The phase shift in units of a whole cycle is then just the time offset between the two signals divided by their period.
How to determine the phase of a sinusoid?
Frequency estimation of a sinusoid (in software) can be done robustly using an autocorrelation. The center peak (lag of 0) will always be a (or the) maximum value. For a periodic signal, you’ll get additional peaks every n lags. This second peak location tells you the period of the signal, in samples. However, you get no phase information.
When to detect positive to negative sine crossing?
That is, you’d only detect a positive-to-negative crossing when the signal dips below some pre-set threshold level −ε, and a negative-to-positive crossing only when it rises above +ε, like this pseudo-C code: