From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to generate an in-sync sinusoid?

I want to generate a sinusoid which will track (with a fixed phase shift) an externally monitored sinusoid.  The signal of interest is a sinusoid of less than 10kHz.  I've heard rumblings of FFTs, PLLs, measuring zero-crossings, etc.  Has anyone done something like this sucessfully? 

 

The important thing is that my generated signal does not become out of sync with my input signal - as would be the case if there were a delta-f in my approximation of frequency.  I need to somehow adjust - in realtime - my sinusoid's parameters such that the two remain synced (again, plus or minus some desired fixed phase shift)

 

I'm just hoping for some informed advice on a direction to take so that I don't go down the rabbit hole in the wrong direction.  I want the rabbit hole to lead me towards the right answer if possible 😉

 

Thanks!

0 Kudos
Message 1 of 3
(2,000 Views)

You need to provide more information.

 

How quickly does the frequency of the external sine change? Is it fixed but only approximately known? Is it a constantly changing signal (a.g. audio)

How are you measuring it (rate, etc.)?

 

What kind of hardware do you have? Is this supposed to be running on an FPGA or some plain old PC?

 

Do you have a simple VI that simulates the instrument?

0 Kudos
Message 2 of 3
(1,996 Views)

altenback - Thanks for a rapid response.

 

1) the external sine is fixed and known and should not change (other than maybe some small unanticipated drift of less than 10Hz or so), but if we just generate a signal with the reference's frequency 'f0' there'll surely be some deviation between what we THINK f0 is and what it ACTUALLY is - hence my desire to incorporate some feedback to assure a lock.

 

2) hardware isn't super important - we can purchase something else, but we currently have a 6368 DAQ and an ARB.  We will just purchase and use whatever works the best I think.  We have a PC, but can also use embedded hardware if that's necessary. 

 

3) The instrument is basic - it just outputs a reference sinusoid and looks at 4 inputs & measures the phase shift.  I do not have a VI to simlate the instrument.

 

Thanks!

0 Kudos
Message 3 of 3
(1,994 Views)