LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ECG power spectrum

Hello! I´m trying to use a vi that calculates an ECG spectrum given an ECG signal. The problem is that the spectrum curve has many peaks, which is not typical of a ECG power spectrum. Could anyone help me finding what should be changed?

Thank you,

Luanna
0 Kudos
Message 1 of 18
(5,971 Views)

Hello Luanna,

A good way to determine the Heart Rate is to collect samples of ECG signal, at least 48KS/s, and calculate the distance (in time) between the two higher peaks (QRS complex peak). This peaks can be detected by using different kinds of math analysis. Inverting the time, you have the HR. This proccess should repeat continously and you can use an aritmetic mean to display an average value.

I hope it helps. Please let me know if you need more information.

Bruno Cesar

 

0 Kudos
Message 2 of 18
(5,950 Views)
For a low frequency signal {and the data you have perhaps 1KHz will be adequate, (Nyquist Theorem, the frequency of interest is tops 40Hz)}. Assuming that the data is simulated with noise /real data you will need to filter the data to remove noise before measurement to remove mains noise and also what I believe is muscle noise and drift.

I believe that you need to construct suitable filters to remove the noise described above. To measure frequency you can then threshold the data and measure the distance between peaks. So this is all done in the time domain.

Do I get a course credit?Smiley Very Happy Perhaps?... check out this LabVIEW Signal Processing ISBN 0-13-972449-4 http://www.phptr.com/title/0139724494?redir=1
http://www.phptr.com/title/0139724494?redir=1#info2 (the code as well).....
Still I remembered what I had read.Smiley Wink


0 Kudos
Message 3 of 18
(5,935 Views)
Hello! Thank you for your help, but i think i missed something...the vi i sent calculates ECG peaks and then uses that curve to calculate power spectrum. I think that the ECG peaks are quite according to the signal on the example, so why is a filter necessary?

Thanks,

Luanna
0 Kudos
Message 4 of 18
(5,932 Views)
Luanna,

What, exactly, do you want to measure? The spectrum of an ECG waveform is very different from the spectrum of the heart rate. A huge body of literature exists on the analysis of ECG signals. Once you have specified the result you seek, someone can help find an algorithm to make the calculations.

Your VI appears to calculate the spectrum of the times of the peaks of the ECG waveform. The FFT is defined on uniformly sampled data. The list of times of peaks is NOT uniformly sampled data. This is the messiest part of heart rate analysis: The easy to obtain data is not easy to analyze.

I won't go any further until I know what you are trying to measure, so that I do not go down a path which has no value to you.

Lynn
0 Kudos
Message 5 of 18
(5,918 Views)
Thanks for answering, i want to measure power spectrum of a RR interval curve. I imagine that the ECG peaks waveform gives me Locations and Amplitudes of the peaks and then i need to calculate RR intervals using these peaks. Given the RR curve, i´ll use that as input to FFT Power Spectrum.
You mencioned the need for evenly spaced data. Can i consider that, for example, the first point on RR curve(which is a dt) is set on time 1s, the second RR is on time 2s and so on?

Thank you!

Luanna
0 Kudos
Message 6 of 18
(5,906 Views)
Hello, John! I´ve changed the vi so it calculates RR intervals, but what should i do about the not evenly spaced data?

Thank you for your help!

Luanna
0 Kudos
Message 7 of 18
(5,880 Views)
Hello Lynn, i want to measure power spectrum of a RR interval curve. I imagine that the ECG peaks waveform gives me Locations and Amplitudes of the peaks and then i need to calculate RR intervals using these peaks. Given the RR curve, i´ll use that as input to FFT Power Spectrum.
You mencioned the need for evenly spaced data. What would be the right way to deal with it considering RR intervals?

Thank you for the help!
Regards,

Luanna
0 Kudos
Message 8 of 18
(5,856 Views)
Luanna,

I have not forgotten this thread. I have not had a chance to look up the literature in the field of heart rate variability and it has been several years since I did much work on the topic, so some of what I say may be out of date.

Heart rate spectra contain a major component at the average heart rate, 60 - 80 beats per minute or RR intervals of 750 - 1000 ms. The heart rate is modulated (frequency modulation) by breathing and by the autonomic nervous system. So components exist at the breathing frequency and at one or two lower freqeuncies (depending upon which papers you read). Making measurements of low frequency components is difficult because the period of some of the components is as long or longer than the time it takes to measure them or the underlying physiological parameter does not remain stable for that period. (Statistically, the process in non-stationary, making analysis more difficult).

One of the issues in spectral analysis of heart rate is "getting your head around" the units. Typical spectral analysis does a Fourier transform of voltage versus time data to obtain voltage versus frequency. In heart rate analysis the data in RR intervals is time versus time which gets transformed to time versus frequency. In addition, as I mentioned previously, the RR intervals are non-uniformly sampled data which cannot be directly transformed by an FFT with meaningful results. I have started to think about the magnitude of the heart rate data in terms of arbitrary "RR units" which of course are actually seconds or milliseconds. By thinking of the data in terms of "RRunits" vs. time, then the spectrum is "RRunits" vs. frequency.

Getting uniformly sampled data for the FFT can be a simple resampling process. Suppose you have a RR interval of 1 second normally and it increases to 1.2 seconds during inspiration. Then for one breath cycle the data would looks like: (sample time,RR unit) (1,1),(2,1),(3,1),(4,1),(5.2,1.2),(6.4,1.2),(7.4,1),...

Resampling at 0.2 second intervals would produce this uniformly sampled representation of the same data: (1.0,1),(1.2,1),(1.4,1),(1.6,1),(1.8,1),(2.0,1),(2.2,1),(2.4,1),(2.6,1),(2.8,1),(3.0,1),(3.2,1),(3.4,1),(3.6,1),(3.8,1),(4.0,1),(4.2,1),(4.4,1),(4.6,1),(4.8,1),(5.0,1),(5.2,1.2),(5.4,1.2),(5.6,1.2),(5.8,1.2),(6.0,1.2),(6.2,1.2),(6.4,1.2),(6.6,1.2),(6.8,1.2),(7.0,1.2),(7.2,1.2),(7.4,1),(7.6,1),(7.8,1),.... Of course various types of interpolation can also be applied.

Lynn
Message 9 of 18
(5,829 Views)
Hi, Lynn, thanks for the great explanation, now i understand more clearly what the problem is. Just a doubt: cant this
resampling become very large, even too large?

Thank you for your help!
Regards,

Luanna
0 Kudos
Message 10 of 18
(5,820 Views)