calculate the phase shift?

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
dds.m.blal
Posts: 7
Joined: Sat Mar 05, 2011 11:10 pm
Contact:

calculate the phase shift?

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: calculate the phase shift?

Post 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.

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: calculate the phase shift?

Post 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
Success always occurs in private and failure in full view.

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: calculate the phase shift?

Post 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

dds.m.blal
Posts: 7
Joined: Sat Mar 05, 2011 11:10 pm
Contact:

Re: calculate the phase shift?

Post 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.

dds.m.blal
Posts: 7
Joined: Sat Mar 05, 2011 11:10 pm
Contact:

Re: calculate the phase shift?

Post by dds.m.blal »

QMESAR can you give me example

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: calculate the phase shift?

Post 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
Attachments
Phase control circuit rev 1.pdf
(26.88 KiB) Downloaded 312 times
Success always occurs in private and failure in full view.

dds.m.blal
Posts: 7
Joined: Sat Mar 05, 2011 11:10 pm
Contact:

Re: calculate the phase shift?

Post by dds.m.blal »

Thank you very much Steve001.

Post Reply