Page 1 of 1

calculate the phase shift?

Posted: Fri Apr 10, 2015 9:28 am
by dds.m.blal
Hello
I am a dentist and interested in electronics and I have a project in Dentistry please help me to find a way to calculate the phase shift between two sine waves using FFT

Re: calculate the phase shift?

Posted: Wed Apr 15, 2015 12:42 pm
by Benj
Hello,

The FFT will give you frequency analysis but not phase analysis.

Depending on your sine wave frequency I would do something like this.

Monitor sine wave 1 until you reach the falling 0V crossover, as soon as you detect the crossover has occurred start a timer running. Then monitor sine wave 2 until you again reach the falling 0V crossover, then stop the timer running and you can convert the time from the timer into a phase difference.

Re: calculate the phase shift?

Posted: Wed Apr 15, 2015 12:51 pm
by Steve001
Thanks Ben
I have also been looking into this For A syncroscope project in the future , whilst reading up capture and compare has been mentioned is this A similar thing

Steve

Re: calculate the phase shift?

Posted: Wed Apr 15, 2015 12:58 pm
by QMESAR
Guys no need to do this so complicated the PIC16F17xx devices and some dsPIC's has zero crossing detection pins
just use the correct mcu and it is that easy :D :D

Re: calculate the phase shift?

Posted: Wed Apr 15, 2015 8:52 pm
by dds.m.blal
Thank you all, I will use the fft in filtering unwanted waves and if relied on the timer as Mr Benj will increase the complexity of the circuit to add external filters and strengthen the signal.

Re: calculate the phase shift?

Posted: Sat Apr 18, 2015 7:58 am
by dds.m.blal
QMESAR can you give me example

Re: calculate the phase shift?

Posted: Sun Apr 19, 2015 8:50 am
by Steve001
Hi dds.m.blal,

Attached is a zero crossing circuit i did a long time ago . Please note it works at 15 volts but can be easily reconfigured for 5 volt operation to a micro
Martin (medelec) has also done a zero crossing circuit posted in this thread

http://www.matrixtsl.com/mmforums/viewt ... 29&t=11350

A Frequency counter here

http://www.matrixtsl.com/mmforums/viewt ... ter#p44700

Martin has also done one but i cannot find it at the moment


Steve

Re: calculate the phase shift?

Posted: Sat Apr 25, 2015 1:42 pm
by dds.m.blal
Thank you very much Steve001.