LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I create a 1D array of data using a custom math function? - Custom Waveform

Hi all,

 

I'm looking to create a custom waveform in LabVIEW without having to create my data in Matlab. I know of MathScript, but I would rather not have to purchase that if it's not necessary.

 

Ideally I should be able to generate a 1D array of double precision data points from a function such as the following:

 

K=3;
fm=10^7;
fc1=K*fm;
Fc=100e3;
T=K/fc1;
fs=K*100e6/(T*Fc);
dt=1/fs;

t=[pi/2:dt:T+pi/2-dt];
f1=cos(2*pi*fc1*t);
f2=cos(pi*fm.*t+pi/4);
f=-f1.*f2;

 

This code was taken directly from Matlab. If you copy and paste it then plot it you will see the function that I am trying to create withing LabVIEW. This function is simply an AM cosine.

 

Thanks for the help,

Marc

0 Kudos
Message 1 of 4
(2,330 Views)

Looking back, I may not have been clear on one point. I don't necessarily have to enter a function, I'm willing to program in LabVIEW and use some signal processing to obtain the same results.However, ultimately I would have to be able to modify the sample rate as I can in my Matlab program with dt.

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

That seems fairly straightforward. What are you having problems with?

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

Yep you're right, after some digging, I found the Formula Waveform VI. Exactly what I needed. Thanks.

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