LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Phase difference of two sine curves with different frequency

Solved!
Go to solution

hello mcduff,
thank you for your quick reply. We now try the solution with the reference signal cos (2pift). We are not sure how to multiply (2pift) by an integer. If we create a cos signal and multiply the whole signal, we get 3*cos(2pift). What blocks do I need to use in Labview to multiply only the part (2pift).
thanks in advance

0 Kudos
Message 11 of 16
(902 Views)

If you are making your own reference, just make new cosine data with a different frequency. Because it is synthetic you don't need to do any multiplications, etc. I suggested the multiplications in case you wanted an EXTERNAL reference, such as from a function generator. To use that reference for higher harmonics then you need the multiplication trick.

 

mcduff

Message 12 of 16
(892 Views)

hi mcduff,
we are currently trying to implement your solution with an internal reference. Now we have the problem that we do not get a quiet signal. In our solution for the second harmonic we don't have this problem. Do you have any idea what could be the reason ?
Thanks for everything

0 Kudos
Message 13 of 16
(875 Views)

I think I am correct that even @mcduff is not a mind-reader, able to "see the code you failed to attach" to understand what you are doing, and thereby explain how to fix it.

 

If you are having a problem with your LabVIEW code and need a suggestion about how to fix it, you should attach your code (not a "picture" of the code) so we can examine it, edit it, and execute it (to see what it really does).  If you are using the LabVIEW Project environment, compress the folder that contains your Project (and the .lvproj file) and attach the resulting .zip file.  This will really help us to help you!

 

Bob Schor

0 Kudos
Message 14 of 16
(864 Views)
Solution
Accepted by topic author maxmustermann132

@maxmustermann132 wrote:

hi mcduff,
we are currently trying to implement your solution with an internal reference. Now we have the problem that we do not get a quiet signal. In our solution for the second harmonic we don't have this problem. Do you have any idea what could be the reason ?
Thanks for everything


As @Bob_Schor said it's hard to help without seeing the problem.

 

I think you step back for a minute and write down the problem you are trying to solve. Think about what you need, what you can measure, and what is missing.

 

For example, if you choose a COSINE function as your reference, there is no need to get the phase of the reference, it is always 0. You are getting the phase from a FFT function; how does that work? Do you get the same answer if you fit the time series data? I have always fit time series data for phase, so I don't have good experience using the FFT. Does it (FFT) depend on the number of points, window function, etc?

 

If it was me, I would probably fit the time series to the following function

 

A ⁢ Cos [ θ ] ⁢ Cos [ 2 ⁢ f ⁢ π ⁢ t ] - A ⁢ Sin [ θ ] ⁢ Sin [ 2 ⁢ f ⁢ π ⁢ t ]

which is equivalent to

A ⁢ Cos [ 2 ⁢ f ⁢ π ⁢ t + θ ]

 

Then I would have my phase for whatever frequency I want, 1st, 2nd, etc, harmonic, all I need to do is change f.

 

mcduff

0 Kudos
Message 15 of 16
(855 Views)

hello mcduff,
sorry for the late message. we got everything done now. thanks again for your detailed help.

0 Kudos
Message 16 of 16
(832 Views)