Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating a random waveform

 

Hello,

 

I need help generating a random wave form (see attachment).   How do I specify a Min/Max step duration to match the graph?

0 Kudos
Message 1 of 9
(5,470 Views)

You should have posted this question to the appropriate language board. It has nothing to do with DAQ hardware. You should also try to avoid attaching word files. It's simpler to just attach the image.

 

From an earlier post, I see you are using LabVIEW. Try the attached example.

Message Edited by Dennis Knutson on 04-22-2009 08:43 AM
Message 2 of 9
(5,456 Views)

Many thanks............

Would you please check the attached vi and let me know how to set a max and min dt (s) values.

Also how can I adjust the logic to automatically set the duration which is sampling time x number of samples?

0 Kudos
Message 3 of 9
(5,442 Views)

I don't understand what you are asking for now. With my example, the dt would be the sample rate and with a waveform, has to be a constant.

 

Your code with the gaussian white noise seems to be being used instead of my example. Here, the dt is set with your sample rate control. If you also want this to be a random number between two values, do the sample thing as the voltage randomization. With your example, the overall duration is set by the value you wire to the for loop's 'N' terminal and the Sampling Time control. If you want to specify duration instead of loop count, divide duration by dt if dt is a constant. If dt is not, then you might want to use a while loop instead of a for loop and stop the while loop with an Elapsed Time function.

0 Kudos
Message 4 of 9
(5,437 Views)

Would you please check the attached file.............

I tried to randomize dt as i did with the voltage control, but it does not seem to make any difference.

0 Kudos
Message 5 of 9
(5,429 Views)
Why should it make a difference? You haven't done anything with it. As I already said, in your code, the dt is the 'Sampling time' control you have wired to the Wait (ms) function. Nor will it do any good to wire anything up to the dt input of the Build Waveform function. The fact that you even have a graph there no makes no sense. The data on the graph is NOT what you are writing to the instrument.
0 Kudos
Message 6 of 9
(5,427 Views)

0 Kudos
Message 7 of 9
(5,422 Views)
In this, I used my random number generator but you can use the white noise generator for the same purpose. The key is wiring the array of random dt values and amplitudes through a for loop and using an XY graph to display the data because you can only use a graph or chart with a constant dt.
Message Edited by Dennis Knutson on 04-22-2009 01:14 PM
0 Kudos
Message 8 of 9
(5,420 Views)

Dennis,

Thank you very much for your help.

 

In the attached vi, I specify Min, Max voltage and Min, Max step duration and the number of random steps, say 2-10(V), 300-1000(ms), and 8 steps respectively.

 

MM5 is to sample the voltage every 2 (ms) "sampling time", the number of samples I would like to read is 500 samples.  How can I sink the output array and MM5 array so that I get the same readings? 

 

Thanks,

0 Kudos
Message 9 of 9
(5,380 Views)