Welcome! Log In Create A New Profile

Advanced

problem with get_analog_data function

Posted by Maria-ChiaraV 
problem with get_analog_data function
February 24, 2022 06:02AM
Hello there,

I am quite new to ML. I am trying to trigger the start of my task with an electromedical machine. I am recording a 5V output signal from this machine with get_analog_data funcion:

[...]
nicolet = get_analog_data('general1');

if nicolet < 4
eventmarker(03);

[...] ....go on with the experiment

end



The output is a 10028x1 matrix with values that goes from ~ 5 (our baseline) to ~ 0 (our signal). Every seventeen sample of ~ 5 we have one signal of ~ 0.
In the I/O testing the signal in the general input tab is correctly read from 5 to 0.
However, even if the output did record the signal, the experiment didn't start.

I have tried the same script with a 5v battery and my task starts correctly.
It is possible that the signal change too fast to be read ?!
Since I have the opportunity to test the script with the machine once in a while any tips are welcome until the next time smiling smiley

Thanks a lot,
MCV
Re: problem with get_analog_data function
February 24, 2022 05:18PM
The signal is indeed too short to detect in that way. You need to read more samples together.
nicolet = get_analog_data('gen1', 10);
if any(nicolet <  4)
    eventmarker(3);
end
Re: problem with get_analog_data function
February 25, 2022 05:17AM
Thank you very much!

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.