LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulating real time signal from waveform

Hello,

 

I'm reading a binary file with signal data. In the file there are signed 16-bit integers, that are values of signal amplitude. The sampling rate of singal was 2kHz.

 

What I want to do is read whole file and then simulate the signal as it was real time (from an array or waveform). How can I accomplish that?

 

In the attachment there is the code, that it's not working as I wanted to.

 

Thanks for any suggestions!

 

 

0 Kudos
Message 1 of 4
(2,508 Views)
Well first, are the 16 bit integers scaled? If not, they will be way too large to send to an analog output. Also, a good place to start is with the daq examples that ship with LabVIEW.

Mike..

PS I'm sorry I can't look at your code as I'm on my phone right now.

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 4
(2,485 Views)

Hi!

 

The integers are not scaled, but this is not important. 

 

I want to simulate the signal as real-time, because I'm going to prepare software for analyzing (phase, power spectrum) that kind of signal, 

because getting the real signal is quite hard (its doppler signal of fetal). As soon as I have a software that actualy does somethig interesting I will prepare the enviroment to test the aquiring also.

 

 

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

Hi and welcome to NI Forums!

 

There are two things I noticed in your code:

  1. The size of the file is in bytes, so it should be divided by 2, not 16.
  2. If you would want to divide the data into chunks (like they are coming from a scope or DAQ card), use the reshape array function, or read it from file inside a for loop.

Cheers:

Andrew Valko
National Instruments Hungary
0 Kudos
Message 4 of 4
(2,366 Views)