LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting square signal into sinusiod avoiding Fourier Transform

I have a clean digitized square wave signal with a frequency around 50 kHz and I would like to convert it into a sinusoid with the same frequency and phase (don't care about amplitude). I would like to do so avoiding the stantard approach that would be  doing the Fourier tranform to measure the frequency and phase and then generating a new sinusoid. Are you aware of any other procedure?

 

Thank you!

0 Kudos
Message 1 of 13
(2,717 Views)

A zero phase lowpass filter would be another way of getting a sinusoid if you insist on having one hand tied behind your back.

0 Kudos
Message 2 of 13
(2,709 Views)

What's up with the FFT-phobia? Is this some kind of homework with silly restrictions? 😮

 

(Even the zero phase filter mentioned by Darin might use FFT like functions internally. ;))

 

Keeping up the facade, here's one way using "extract single tone". (Which also uses FFT internally).

 

 

 

Of course you could get a good initial estimate on the frequency and phase by measuring the zero crossings, then fit to a sine function with adjustable amplitude, phase and frequency using levenberg-marquardt. Suddenly, FFT seems like a better idea :D.

0 Kudos
Message 3 of 13
(2,702 Views)

@altenbach wrote:

What's up with the FFT-phobia? Is this some kind of homework with silly restrictions? 😮

 


Perhaps the OP only have Labview Base 😉 I think the OP should tell us why FFT is out the question. Good questions draw good answers.



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 4 of 13
(2,692 Views)

@COq Rouge wrote:
Perhaps the OP only have Labview Base 😉 I think the OP should tell us why FFT is out the question.

Even in LabVIEW base, doing an FT (well, it won't be as "fast" ;)) is not that complicated. 😄

 

 

Message 5 of 13
(2,683 Views)

I was using exactly the extract single tone solution proposed by altenbach. The reason I was asking this is that the Fourier Transform seems to me not terribly good at finding the phase of the digitized square signal. For example if I use this same square signal as a trigger source the measured phase should be  0,  but the  extract single tone function is giving me values oscillating between plus minus 5 degrees for sampling rates of 2MHz, which looks like too much.

0 Kudos
Message 6 of 13
(2,663 Views)

Can you give some example data? 2MHz does not tell us much. How many points are in the dataset and how many transitions? How much noise? Are the number of points an exact multiple of the wavelenght?

Message 7 of 13
(2,660 Views)

Sampling a 50 kHz signal (as mentioned in the original post) at 2 MHz gives about 40 samples per cycle or 9 degrees between samples.  Sounds like +/-5 degrees is the expected variation if the sampling is not exactly synchronous.

 

Lynn

0 Kudos
Message 8 of 13
(2,650 Views)

I attach a vi that includes a real dataset. The number of points is quite large since I also need a good resolution in the frequency measurement.

 

This dataset was obtained using the same signal as trigger source.

 

 

0 Kudos
Message 9 of 13
(2,645 Views)

It seams to me that you are trying to make PLL http://en.wikipedia.org/wiki/Phase-locked_loop in Labview. If you google PLL labview

I am sure you may find something. But this is not something I have done my self



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 10 of 13
(2,625 Views)