Jump to content

phase difference between two signals...


Recommended Posts

Hi,

     

            I am trying to find phase difference between two acquired signals. In this project I varies frequency of input voltage continuously using for loop and measure two output voltages corresponds to each frequency from my circuit. I need to find the phase difference between two voltages accurately. Here I used "frequency amplitude" vi.. but each time when I execute the program with same circuit for particular frequency, phase difference changes... Is there any other method suitable for this project to calculate phase difference... I attached my vi along with this post.

 

 

                                             Thanking you,

                                                    Manu

phase.vi

Link to comment

Your code makes me sad.  I've seen worst code before but your code should be cleaned up and documented before your project is complete.

 

First issue you will run into is the fact that your DAQ card is probably not a simultaneous sampling card.  So when you tell the card to read 1000 samples on two channels, it will read 1000 samples on one channel, then 1000 samples on the next channel.  So your samples will not be taken at the same time, and your phase will not be correct because by the time you are done taking 1000 samples on the first channel, the second waveform will have changed.  If you are taking measurements at the same time then this isn't an issue but many DAQ cards don't support this.

 

Have you tried graphing the two signals you read?  This may help in seeing why the phase calculation is not what you expect.

 

Attached is a VI that calculates the phase difference between two signals using the same technique you have and it gives the correct results even with noise.

Signal Phase.vi

  • Like 1
Link to comment

Hi hoovahh,

 

               Sorry for my bad vi, that I posted. I graphed signals. signals are acquiring, but there is tilt in timing. Here I am using 6368 card for acquiring and generating signals. is this the problem of phase variation? I am using internal trigger also.

                                   Manu

Link to comment

Hi,

Hoovah's comment isn't totally accurate. On a multiplexing card if you request 1000 channels on 2 channels it doesn't do 1000 chn1 then 1000 chn2. Rather it takes one from each at a time so chn1 - chn2 - chn1 - chn2 ...... This does still cause a small phase error though.

The good thing is the card you have is a simultaneous card so it truly can acquire on both without phase error.

Good luck!

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.