LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Frequency shift pulse modulation (DAQmx)

Good morning,

 

I have written this simple program which reads ones and zeroes from a txt file, and modulates pulses. When 0, creates one pulse with certain freq, when 1, creates two pulses with 2*frequency (so 1 bit each 1000/freq ms)

 

For lower frequencies that 250/500Hz it works perfect. For higher frequencies, it do strange things and I just can't see why. For instance, when I tried this binary serie (1 0 0 1 0 0 1 0 0..) it should be 2 slow pulses, 2 fast pulses; and it shows 3 fast pulses, 1 slow pulse. If I try higher frequencies it do weird things. 

 

What confuses me most is how it perfectly works for lower freq than 500 and not on higher. Any ideas?

 

Thank you in advance,

Bernard

Download All
0 Kudos
Message 1 of 4
(2,780 Views)

In this other approach, instead of changing frequency in function of the bit, I start one or another pre-configurated signal (with freq and number of samples), each bit.

 

Also not working, it seems like it takes too much time to process the functions "stop task" and then "start task" again.

 

Any ideas?

 

--

 

BTW I have just downloaded the Modulation Toolkit, can it be used for my purpose?

0 Kudos
Message 2 of 4
(2,769 Views)

Using a time loop instead of while it works untill 500/1000Hz. An improvement, but still far from what I need. And still have no idea why it won't work on faster freq. I attach this VI.

 

----

 

I have thought about creating two continuous pulses with frequencies f1=2*f0 and start both tasks. Then, multiply the fast signal for the binary serie, in a timed loop with certain period (T=1/f0), so there will be 2 pulses with f1 when bit is 1 and a zero signal when bit is 0. At the same time multiply the slow signal for the inverse of my binary serie, so when the bit is 0 it will become 1, and the slow signal will show one pulse and when bit is 1 it will become 0 and the signal will be zero. Combining this two signals I would get the modulated signal. 

Maybe this way its faster because you dont have to change the channel propierties on the fly but changing the signal itself and then outputing it. But I have no idea how to do this with the DAQmx functions.

(Sorry for my english, this is hard to explain.)

 

---

 

I am using NI DAQ 6363, forgot to say.

 

 

0 Kudos
Message 3 of 4
(2,730 Views)

Solved. I had to use the Write data function with the waveform data.

0 Kudos
Message 4 of 4
(2,687 Views)