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
calculate the phase shift?
Moderator: Benj
-
- Posts: 7
- Joined: Sat Mar 05, 2011 11:10 pm
- Contact:
- 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?
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Steve001
- 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?
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
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.
- QMESAR
- 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?
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
just use the correct mcu and it is that easy
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR
-
- Posts: 7
- Joined: Sat Mar 05, 2011 11:10 pm
- Contact:
Re: calculate the phase shift?
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.
-
- Posts: 7
- Joined: Sat Mar 05, 2011 11:10 pm
- Contact:
- Steve001
- 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?
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
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.
-
- Posts: 7
- Joined: Sat Mar 05, 2011 11:10 pm
- Contact: