07-07-2005 08:39 AM
Ratnam, you started a post in the middle of this thread (unable to display waveform / multiple recording). I have transferred the discussion to a new thread so that it will get the proper visibility.
To answer your questions. Your main problem is you are collecting 1000 data points at 5kHz. Heart rates tend to be somewhere between 1Hz and 2Hz (60 to 120 beats/minute). Since you only have 200ms of data, you end up with about 1/5 of a heartbeat. This means your autocorrelation is essentially noise. Decrease your acquisition rate to 500Hz and your number of data points to 2000. This will give you four seconds of data. Then run your autocorrelation. You should probably look for peaks, not valleys. Find the peaks (use a threshold to remove noise). Either subtract the distance between two adjacent peaks to get the heart period, or, for some averaging, do a line fit on peak index vs. position and use the slope to get the period.
As an alternate, you may consider using Extract Single Tone Information.vi on your data. It will give you the frequency directly. However, it is not really accurate for less than about ten periods, which would be ten seconds of data. I don't know what your update times need to be.
As you may expect, there are techniques to get faster update times (once per beat), but they require some fairly advanced programming techniques . I would strongly suggest you read the attachment in the first thread about large LabVIEW applications before you attempt such a thing. If applied, the information there will save you a lot of time and effort in the long run.
Good Luck!
07-07-2005 09:05 AM
07-08-2005 08:40 AM