DSPRelated.com
Forums

Filtering for heart rate extraction.

Started by Unknown February 27, 2013
On Feb 27, 10:44�am, zoulzub...@googlemail.com wrote:
> hey guys, i am trying to design a filter to extract the signal of a beating heart from a voltage response to a 200khz sinusoid i am passing though a volunteer.the 200kHz voltage response signal is sampled at 2e6 samples per second and the noise levels are around 0.8%. what would be the best approach to this problem assuming normal heart rate of 72 beats pre minute(1.2Hz)? thanks very much.
Your approach is flawed Not sure what you are trying to accomplish, but even normal heartbeat (without passing electric current through a subject) is irregular, i.e. there is no fundamental at 1.2 Hz - it's just a number of cycles per second averaged over a minute Why do you think you can get anything meaningful using ordinary linear filters ? Hearbeat is a classical example of a nonlinear signal My advice: forget about it - you're in way over your head
On Thu, 4 Apr 2013 06:46:53 -0700 (PDT), angrydude
<simfidude@gmail.com> wrote:

>On Feb 27, 10:44=A0am, zoulzub...@googlemail.com wrote: >> hey guys, i am trying to design a filter to extract the signal of a beati= >ng heart from a voltage response to a 200khz sinusoid i am passing though a= > volunteer.the 200kHz voltage response signal is sampled at 2e6 samples per= > second and the noise levels are around 0.8%. what would be the best approa= >ch to this problem assuming normal heart rate of 72 beats pre minute(1.2Hz)= >? thanks very much. > >Your approach is flawed > >Not sure what you are trying to accomplish, but even normal heartbeat >(without passing electric current through a subject) is irregular, >i.e. there is no fundamental at 1.2 Hz - it's just a number of cycles >per second averaged over a minute > >Why do you think you can get anything meaningful using ordinary linear >filters ? > >Hearbeat is a classical example of a nonlinear signal > >My advice: forget about it - you're in way over your head
I don't know why you think nothing meaningful can come from using an ordinary linear filter on the detected resistance. A heart beat is like any real-world periodic signal. It has some jitter, perhaps more than most other signals you are familiar with. But it is pure enough that a bandpass filter centered at 1.2 Hz with a fairly wide bandpass could conceivebly clean up the signal enough to reveal the 1.2 Hz. fundamental, which will show up in an FFT despite your claim to the contrary. We must assume that there are several levels of filtering going on here. First the raw current signal needs to be narrowly filtered for 200 kHz prior to envelope detection. This might be followed by a bit of low pass filtering to suppress the 400 kHz and higher signals that might result from full-wave rectification (as part of envelope detection). Now we have a signal that is still fairly high bandwidth that represents the dynamic impedance. Finally we get down to the point of filtering this signal to find the 1.2 Hz component that represents the changes in impedance due to the beating heart. There are plenty of uses for standard linear filters in this project. Robert Scott Hopkins, MN
On Apr 4, 11:04&#4294967295;am, no-...@notreal.invalid (Robert Scott) wrote:
> On Thu, 4 Apr 2013 06:46:53 -0700 (PDT), angrydude > > > > > > <simfid...@gmail.com> wrote: > >On Feb 27, 10:44=A0am, zoulzub...@googlemail.com wrote: > >> hey guys, i am trying to design a filter to extract the signal of a beati= > >ng heart from a voltage response to a 200khz sinusoid i am passing though a= > > volunteer.the 200kHz voltage response signal is sampled at 2e6 samples per= > > second and the noise levels are around 0.8%. what would be the best approa= > >ch to this problem assuming normal heart rate of 72 beats pre minute(1.2Hz)= > >? thanks very much. > > >Your approach is flawed > > >Not sure what you are trying to accomplish, but even normal heartbeat > >(without passing electric current through a subject) is irregular, > >i.e. there is no fundamental at 1.2 Hz - it's just a number of cycles > >per second averaged over a minute > > >Why do you think you can get anything meaningful using ordinary linear > >filters ? > > >Hearbeat is a classical example of a nonlinear signal > > >My advice: forget about it - you're in way over your head > > I don't know why you think nothing meaningful can come from using an > ordinary linear filter on the detected resistance. &#4294967295;A heart beat is > like any real-world periodic signal. &#4294967295;It has some jitter, perhaps more > than most other signals you are familiar with. &#4294967295;But it is pure enough > that a bandpass filter centered at 1.2 Hz with a fairly wide bandpass > could conceivebly clean up the signal enough to reveal the 1.2 Hz. > fundamental, which will show up in an FFT despite your claim to the > contrary. > > We must assume that there are several levels of filtering going on > here. &#4294967295;First the raw current signal needs to be narrowly filtered for > 200 kHz prior to envelope detection. &#4294967295;This might be followed by a bit > of low pass filtering to suppress the 400 kHz and higher signals that > might result from full-wave rectification (as part of envelope > detection). &#4294967295;Now we have a signal that is still fairly high bandwidth > that represents the dynamic impedance. &#4294967295;Finally we get down to the > point of filtering this signal to find the 1.2 Hz component that > represents the changes in impedance due to the beating heart. &#4294967295;There > are plenty of uses for standard linear filters in this project. > > Robert Scott > Hopkins, MN- Hide quoted text - > > - Show quoted text -
Don't know about others, but mine has had occasional extra beats for a very long time and cardiologist says it's fine and there are plenty of people like this This is under normal relaxed conditions and I would not volunteer to be a subject of OP's experiment :-) Anyway, the concept of "fundamental frequency" is pretty meaningless in this case as the signal is not periodic
>Don't know about others, but mine has had occasional extra beats for a >very long time and cardiologist says it's fine and there are plenty of >people like this >This is under normal relaxed conditions and I would not volunteer to >be a subject of OP's experiment :-) >Anyway, the concept of "fundamental frequency" is pretty meaningless >in this case as the signal is not periodic >
I agree that you aren't going to be able to filter the signal down to a single sinusoid at a frequency equal to the fundamental frequency of the heart rate because the heart beats aren't necisarrily evenly spaced. However, there seems to be enough information in the signal to try and detect individual heart beats, which could be used to estimate heart rate in the same way you would with two fingers and a stop watch. The image of the signal provided is a bit too coarse to make any recommendations, but it looks like it can be done.
On 4/4/2013 12:42 PM, dszabo wrote:
>> Don't know about others, but mine has had occasional extra beats for a >> very long time
> I agree that you aren't going to be able to filter the signal down to a > single sinusoidat a frequency equal to the fundamental frequency of the > heart rate because the heart beats aren't necisarrily evenly spaced.
Correlate observed effect to the heart beat obtained by some other method (i.e. ECG or stethoscope). At least this would give an estimate of the magnitude of the effect and the signal to noise ratio. Q: Why it is impossible to have sex in Red Square in Moscow ? A: Because every bystander idiot would be trying to give his invaluable advice. Vladimir Vassilevsky DSP and Mixed Signal Designs www.abvolt.com
On Thursday, 4 April 2013 23:58:24 UTC+1, Vladimir Vassilevsky  wrote:
> On 4/4/2013 12:42 PM, dszabo wrote: > > >> Don't know about others, but mine has had occasional extra beats for a > > >> very long time > > > > > I agree that you aren't going to be able to filter the signal down to a > > > single sinusoidat a frequency equal to the fundamental frequency of the > > > heart rate because the heart beats aren't necisarrily evenly spaced. > > > > Correlate observed effect to the heart beat obtained by some other > > method (i.e. ECG or stethoscope). At least this would give an estimate > > of the magnitude of the effect and the signal to noise ratio. > > > > > > Q: Why it is impossible to have sex in Red Square in Moscow ? > > A: Because every bystander idiot would be trying to give his invaluable > > advice. > > > > Vladimir Vassilevsky > > DSP and Mixed Signal Designs > > www.abvolt.com
Hey guys, so after all the speculation turns out it is indeed possible to extract the signal of interest as shown in picture with baseline drift removed. https://dl.dropboxusercontent.com/u/48735904/removed_baseline_drfit.jpg three equiripple LPF stages were used with cutoff of 10kHz(~-25dB stopband attenuation), 300Hz(signal from first stage downsampled to 10kSa/sec from 2MSa/sec, ~-20dB stopband attenuation) Hz and the last at 10hz(~-80 dB stopband attenuation). Envelope detection didnt work with both hilbert transform or signal squaring method but i learned a lot about the methods so no complaints. Now could anyone guide me in a right direction in counting the number of peaks? thresholding method could work but some times the baseline drift is not completely eliminated which could cause errors but in all filtered signals the peaks do stand out visibly. Thanks very much for your input guys much appreciated.
On Sun, 14 Apr 2013 08:34:30 -0700 (PDT), zoulzubazz@googlemail.com
wrote:

>Now could anyone guide me in a right direction in counting the number of pe= >aks? thresholding method could work but some times the baseline drift is no= >t completely eliminated which could cause errors but in all filtered signal= >s the peaks do stand out visibly. Thanks very much for your input guys much= > appreciated.
What I would do is develop a dynamic threshold as follows. Simulate a positive peak level detector with instant response in the upper direction and slow exponential decay in the downward direction. This will create an upper threshold that approximately tracks the upper peaks. Then take a certain fraction of that upper threshold, perhaps 0.6 would be good, and use that fraction of the upper threshold to count peaks. Adjust the fraction as necessary. If the variability of the peaks is too high so that sometimes a peak fails to rise to 0.6 times the dynamic upper peak level, lower the fraction. If the noise level around the baseline is too high so that sometimes a noise spike is interpretted as a counted peak, raise the fraction. To avoid counting a peak twice due to noise you could implement either (1) a re-trigger lockout time or (2) some hysteresis in the thresholding, such as 0.6 required for beginning of peak detection and 0.5 required for end of peak detection. I would also look into raising the cutoff frequency of your baseline restore filter (high-pass filter). Even your "baseline corrected" graph shows more response than necessary to frequencies that are much lower than the frequencies that create the peaks you want to count. I would say roughly a 5 x increase would be good for a start. Robert Scott Hopkins, MN
On 4/14/13 3:19 PM, Robert Scott wrote:
> On Sun, 14 Apr 2013 08:34:30 -0700 (PDT), zoulzubazz@googlemail.com > wrote: > >> Now could anyone guide me in a right direction in counting the number of pe= >> aks? thresholding method could work but some times the baseline drift is no= >> t completely eliminated which could cause errors but in all filtered signal= >> s the peaks do stand out visibly. Thanks very much for your input guys much= >> appreciated. > > What I would do is develop a dynamic threshold as follows. Simulate a > positive peak level detector with instant response in the upper > direction and slow exponential decay in the downward direction. This > will create an upper threshold that approximately tracks the upper > peaks. Then take a certain fraction of that upper threshold, perhaps > 0.6 would be good, and use that fraction of the upper threshold to > count peaks. Adjust the fraction as necessary. If the variability of > the peaks is too high so that sometimes a peak fails to rise to 0.6 > times the dynamic upper peak level, lower the fraction. If the noise > level around the baseline is too high so that sometimes a noise spike > is interpretted as a counted peak, raise the fraction. To avoid > counting a peak twice due to noise you could implement either (1) a > re-trigger lockout time or (2) some hysteresis in the thresholding, > such as 0.6 required for beginning of peak detection and 0.5 required > for end of peak detection. I would also look into raising the cutoff > frequency of your baseline restore filter (high-pass filter). Even > your "baseline corrected" graph shows more response than necessary to > frequencies that are much lower than the frequencies that create the > peaks you want to count. I would say roughly a 5 x increase would be > good for a start. >
it's funny, because much of this sorta technique has been used for pitch detection or the estimation of period length for speech or audio. but it doesn't always work so good. dunno how well it works for ECG signals. if you were to do a traditional autocorrelation or AMDF on ECG signals (as we have done with speech, audio, or musical tone signals), i think that would work except when there is arrhythmia and then i just dunno how well it would work. Dmitry dude, what do you think? -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."