Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 69001

Deterministic loop is delayed when continuously rewriting AO's buffer

$
0
0

Hello everyone!

I am using the RT module for neurofeedback: Analyzing brain activity and then giving the user auditory feedback about it.
My RT target is a desktop pc and I use the typical deterministic + nondeterministic loop structure.

 

What I want is to continuously output a pure tone. The amplitude of the tone is calculated in real time and depends on some feature of the user's brain activity. It should vary smoothly to avoid click-like artifacts.


Since there are no sound VIs in the RT module, I use the DAQmx write VI (analog output) with regeneration enabled. The sample mode is continuous.

Before the first iteration, I generate a sine wave of an appropiate length (some hundred samples) and amplitude 1. Then, on each iteration, I compute the new value of the amplitude and multiply the sine wave with a linear ramp so that I get a smooth amplitude modulation. On the same iteration I write this new piece of data with the DAQmx write VI.

 

WIth this approach my timed loop gets delayed periodically, even thought the cpu load stays below 20%. It seems that continuously rewriting the device's buffer is the problem.

 

Is there a cleverer way of doing what I want? For instance: Could I write the pure tone only in the beginning and then control the amplitude by setting a gain? I have seen that a gain property exists ( http://zone.ni.com/reference/en-XX/help/370469AA-01/daqmxprop/attr118/ ) but I fail to find it. I am using LV 9.

 

I will be very grateful for any ideas!

Thank you!


Viewing all articles
Browse latest Browse all 69001

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>