burcu;

I cannot run your code because there are some VIs that are missing
("ADAC Get Board Selections" and "ADAC AI Continuous Scan"). Anyway,
chances are they include a dll call or something that communicate with
the hardware, so I won't be able to execute it anyway.

Just looking at your code, if you are using the default values, the
sampling at 1 kHz and then requesting only 100 points at each loop,
you are not going to see anything! I am not expert in physiology, but
if you are measuring respiration... let say a person breathe normally
at an average of 1 full cycle every 4 seconds, then the input to the
Peak Detector VI is a straight line, thus only one peak! Try changing
the parameters to something like 100 Hz and 800 points. If the
breathing assumption is correct, you should acquire about two full
breathing cycles. 100 Hz is still a lot resolution for a signal so low
in frequency. Try lowering the sampling frequency to 20 or 10 Hz. Even
if you keep the number of points at 100, you will get more peaks that
you need. The key is to learn how to manipulate the sampling rate and
the number of samples.

Finally, to calculate the breathing rate: once you substract the
points as you are doing, multiply that number to the actual sampling
period and then invert.

Reply via email to