10-29-2012 03:44 AM
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
10-29-2012 06:23 AM
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?
10-30-2012 08:18 AM
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.
11-07-2012 02:20 AM
Solved. I had to use the Write data function with the waveform data.