LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to synchronize analog signals

I have two analog inputs, one is lagging behind the other. I was wondering if there is a good way to synchronise them. I was thinking of delaying one of the signals. I also would like to change the delay when the vi is running, if possible. Thanks.
0 Kudos
Message 1 of 4
(2,741 Views)
If your signals are represented as arrays, say A and B, then simply use index Ai = index Bi+d where d is the amount of delay. Depending on what you are doing with the data, you might need to run the array B through a for loop and create a new delayed array B'.

If you describe what you are trying to do, someone may be able to offer a better solution.

Lynn
0 Kudos
Message 2 of 4
(2,741 Views)
I have a patient breathing and I am constantly sampling gases from the mouth. I have a signal from gas analyzer (Signal A) telling me concentrations of expired gas and from pressure transducer telling me what part of the breath cycle I am in (Signal B). Signal A is slower than signal B. I want to align them, so that I know exactly what concentraion of gas occurs during which part of the breath. I want to record raw aligned signals (bith A and B), but also be able to pick the concentration of expired gas just prior to the start of inspiration and record them on breath-by-breath basis - that's why it's critical to align the signals.

Please help!!! Thanks.
0 Kudos
Message 3 of 4
(2,741 Views)
This is a tricky problem because there is no good way to determine precisely the delay between the two signals. The time for the gas to flow from the pressure measuring point to the gas analyzer may vary with pressure, that is, the forcefulness of inpsiration or expiration. The speed of the analyzer is probably specified by the manufacturer. Some take a few seconds to produce an accurate reading.

If you know or can calibrate all those times, you can shift one set of data samples by that amount of time to align them. For example let the sampling rate be 10 Hz on each channel. If the analyzer signal is found to be delayed by 2.5 seconds, then the alignment would be 25 samples shifted (Delay Number of Samples = Sample Rate * Delay Time). If
both signals are in arrays A and B, then the aligned samples would be A[i] <=> B[i+25].

Lynn
0 Kudos
Message 4 of 4
(2,741 Views)