LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Real-Time Grayscale Image Writing

Greetings,

 

I started learning LabView a little less than two weeks ago for a research project that I am working on, and have been writing a program while learning. The code I have, which can be found in the attachment below, in summary collects the peak intensity value of a 10ms range for every 50ms of audio input, and then adds the peak to an array. The array is then normalized for 16-bit grayscale imaging, and is sorted into a 200x100 matrix. Using the IMAQ VI's available through the Vision Acquisition software pack, I then converted the 200x100 matrix into an image which is produced at the end of the program's cycle.

 

I am currently using an audio signal because I have not received the devices though which I will be collecting data yet, so the sound format is simply set at 100,000 samples per second, 2 channels, and 16 bits per sample.

 

Moving forward with the program, I have been trying to figure out how I can alter my code so that the image produced at the end updates in real time as the data is collected, as opposed to just at the end of the data collection. And I would like to do this without jeopardizing the speed and efficiency of the program. If anyone might be able to help me figure out how I might be able to do this, the help would be more than welcome and greatly appreciated. Typically, when I am just test-running the program, I will set the iteration count of the first loop from 100,001 to a smaller value such as 1,001. In general, any suggestions for improving the code's efficiency would be welcome as well, although the real-time image updating is my primary focus at the moment.

 

Regards,

Nicholas

0 Kudos
Message 1 of 2
(2,632 Views)

Hi Nicholas,

 

I suggest you do something along these lines

Initialize a matrix with all 0s. Take in the data and manipulate it. Insert the data into the matrix cell by cell on each iteration. You can do this with a for loop or a while loop.

 

The forums work better if you have specific questions, just fyi.

 

I attached a very generic VI that may help you understand what I mean.

 

Welcome to LabVIEW!

 

Michael

 

Michael Bilyk
Former NI Software Engineer (IT)
0 Kudos
Message 2 of 2
(2,589 Views)