10-04-2008 08:00 PM
Hey guys
Im having some trouble with this. I have read most of the topics related to this but none of the solutions posted have helped me.
I have this small circuit and im taking some voltage values using my pc sound card. Data acquisition is working ok. As you might know, the sine wave read in the resistor terminal has a phase different in comparison to the inicial wave read at the capacitor terminal. I have tested the VI file and i can confirm this in the graphics i see there.
I have been having trouble identifing the phase difference (in degrees) between both waves.
I would really appreciate if you could help me out with this. Here is my VI file in case someone can give me some suggestions on how to calculate the phase difference in degrees. Also, in this VI, there are some tests i made with no good results at all.
Any help will be appreciated
Solved! Go to Solution.
10-04-2008 10:22 PM - edited 10-04-2008 10:22 PM
Hi moreins,
I have seen your VI and I have calculated phase difference between two signals before. From my point of view, your code is doing ok. So, can you provide me with your signals? Just add Write to Measurement File, set to LVM file and X value Column as One Column per Channel and send me the LVM file. It would give me a better idea on troubleshooting your problems.
Looking forward for your reply,
Krisna Wisnu
10-05-2008 12:27 AM
hey
thanks for the reply
im not home right now so theres no way to get the info you are needing. let me do that for you as soon as i get home and i will send it asap
thanks!
10-05-2008 10:45 AM - edited 10-05-2008 10:51 AM
heres the lvm file. i hope this can provide you more info.
i had trouble creating the lvm file so let me know if the file has what you need
10-05-2008 09:22 PM
Hi moreins,
I have changed the code, check this out! I provided two solutions which either way works to calculate phase difference.
Let me know if this solution works for you or not. Have a nice day!
Sincerely,
Krisna Wisnu
10-06-2008 08:59 AM - edited 10-06-2008 09:05 AM
hello Krisna
thanks a lot for all the help given. the code you provided me works very vell. both methods are very useful and im gonna run some test to see which one adapts better to mi needs.
i have only one question. i ran the code you gave me with the lvm file i made yesterday and the phase difference is around 270°. ¿dont you think thats way too much? beacuse, when i look at both signals at the graphic they look they hardly have less than 90° of phase difference.
what do you think about this? should i susbtract 360° to the result that both methods is giving me??? because if i do that, im getting acceptable phase difference values
thanks again for everything!
10-06-2008 09:05 AM
Depends which one has been used as the reference sine wave. 1-2 = 90 Degrees, whilst 2-1 = 270 Degrees.
Craig
10-06-2008 09:07 AM
the white signal is the one that comes from the the signal generator.
im confused now
10-06-2008 09:21 AM
If the white one is the one from the signal generator and the red one is the delayed signal then the phase shift is the amount of phase to the right of the white signal. So if you are expecting 90 degrees of phase shift you will have to modify the code so that instead of subtracting like so (Phase of white- Phase of red) you subtract like so (Phase of red- Phase of white). I cannot see your code as i am working in 8.2 otherwise i might of been a bit more help.
Another way is to subtract your existing answer from 360 Degrees. i.e if you are getting say 271 Degrees, then subtracting this from 360 gives you 89 Degrees 🙂
Always more than one way to skin a cat 😉
Craig
10-06-2008 10:01 AM - edited 10-06-2008 10:05 AM
craigc wrote:Another way is to subtract your existing answer from 360 Degrees. i.e if you are getting say 271 Degrees, then subtracting this from 360 gives you 89 Degrees 🙂
thanks a lot for this. thats what i thought since its kinda weird having 271° of phase difference!
thanks a lot for this hint!