Dear comp.dsp I'm a ECE undergrad student. I'm using Matlab to clean up unipolar cardiac = electrogram recordings. I expect signals between 30 and 500 Hz. However, I = have noticed significant noise at 60 Hz and its harmonics (you can see peak= s in the PSD at 60,120,180,... Hz). We are sampling at 25 kHz. My question is: since I'm expecting signals in the 30 to 500 Hz range, how = should I filter out the harmonics? I could do a comb filter after decimatin= g the original signal, but I don't want to cancel out the actual signal. Is there a way to get rid of these peaks by, for example, replacing the har= monic peaks by interpolated values from neighboring frequencies? I've read = that interpolation in the frequency is tricky. Thank you for your time. - Fernando
Filtering 60 Hz harmonics in cardiac electrogram
Started by ●August 21, 2012
Reply by ●August 21, 20122012-08-21
f.quivira@gmail.com wrote:> Dear comp.dsp > > I'm a ECE undergrad student. I'm using Matlab to clean up unipolar cardiac electrogram recordings. I expect signals between 30 and 500 Hz. However, I have noticed significant noise at 60 Hz and its harmonics (you can see peaks in the PSD at 60,120,180,... Hz). We are sampling at 25 kHz. > > My question is: since I'm expecting signals in the 30 to 500 Hz range, how should I filter out the harmonics? I could do a comb filter after decimating the original signal, but I don't want to cancel out the actual signal. > Is there a way to get rid of these peaks by, for example, replacing the harmonic peaks by interpolated values from neighboring frequencies? I've read that interpolation in the frequency is tricky. > > Thank you for your time. > > - FernandoI'm an antique. What is "ECE"? However, back in the 60's I was a BSEE student working as an electronics tech for the university's veterinary physiology department. We had lousy EEG and EKG signals that I could never filter successfully. Understood years later why it is better to "prevent interference" than to "ATTEMPT to REMOVE interference". Filtering after the fact is not a good answer. Do you have the possibility of getting better data? Or are you stuck trying to ... ... ... ;/
Reply by ●August 21, 20122012-08-21
> I'm an antique. What is "ECE"?ECE means Electrical and Computer Engineering. It's a dual major program :)> However, back in the 60's I was a BSEE student working as an > electronics tech for the university's veterinary physiology > department. We had lousy EEG and EKG signals that I could > never filter successfully. Understood years later why it is > better to "prevent interference" than to "ATTEMPT to REMOVE > interference".What do you mean by preventing interference? Does that mean having shielded wires going from the electrodes to the data acquisition system? Or does that mean to have hardware analog filters before sampling is done?> Filtering after the fact is not a good answer. > Do you have the possibility of getting better data? > Or are you stuck trying to ... ... ... ;/Right now, the acquisition box has a 60 Hz notch filter, but it doesn't get rid of the harmonics. Therefore, I'm stuck trying to do this :/
Reply by ●August 21, 20122012-08-21
What I'd try is - take a piece of signal with an exact integer length of 60 Hz cycles - fft - zero out the n * 60 Hz bins at positive and negative frequencies - ifft (and discard the very small imaginary part, it's roundoff noise) This is more or less ideal, as long as your powerline hum and the acquisition clock are free of phasenoise. More advanced (nonlinear) methods would use a PLL, for example. If you search for this, you'll probably find more info than you can read in a lifetime.
Reply by ●August 21, 20122012-08-21
Reply by ●August 21, 20122012-08-21
On Tue, 21 Aug 2012 10:43:35 -0700, f.quivira wrote:>> I'm an antique. What is "ECE"? > ECE means Electrical and Computer Engineering. It's a dual major program > :) > >> However, back in the 60's I was a BSEE student working as an >> electronics tech for the university's veterinary physiology department. >> We had lousy EEG and EKG signals that I could never filter >> successfully. Understood years later why it is better to "prevent >> interference" than to "ATTEMPT to REMOVE interference". > > What do you mean by preventing interference? Does that mean having > shielded wires going from the electrodes to the data acquisition system? > Or does that mean to have hardware analog filters before sampling is > done?Hardware analog filtering is just attempting to remove interference in the analog domain rather than digital. He means shielded wires, or balanced wires, or whatever it takes to keep the 60Hz from getting into your electronics in the first place.>> Filtering after the fact is not a good answer. Do you have the >> possibility of getting better data? Or are you stuck trying to ... ... >> ... ;/ > > Right now, the acquisition box has a 60 Hz notch filter, but it doesn't > get rid of the harmonics. Therefore, I'm stuck trying to do this :/-- My liberal friends think I'm a conservative kook. My conservative friends think I'm a liberal kook. Why am I not happy that they have found common ground? Tim Wescott, Communications, Control, Circuits & Software http://www.wescottdesign.com
Reply by ●August 21, 20122012-08-21
On Tuesday, August 21, 2012 11:47:25 AM UTC-5, f.qu...@gmail.com wrote:> Dear comp.dsp I'm a ECE undergrad student. I'm using Matlab to clean up u=nipolar cardiac electrogram recordings. I expect signals between 30 and 500= Hz. However, I have noticed significant noise at 60 Hz and its harmonics (= you can see peaks in the PSD at 60,120,180,... Hz). We are sampling at 25 k= Hz. My question is: since I'm expecting signals in the 30 to 500 Hz range, = how should I filter out the harmonics? I could do a comb filter after decim= ating the original signal, but I don't want to cancel out the actual signal= . Is there a way to get rid of these peaks by, for example, replacing the h= armonic peaks by interpolated values from neighboring frequencies? I've rea= d that interpolation in the frequency is tricky. Thank you for your time. -= Fernando Get a copy of a book by Widrow and Stearns titled Adaptive Signal Processin= g. In there you will find a section titled "Cancelleing 60-Hz Interference = in Electrocardiography". Your library should have a copy, or can get one ea= sily. Be sure to check with your prof to see if (s)he wants you to go this = route to clean up the signal. Maurice
Reply by ●August 21, 20122012-08-21
On 21.8.12 9:43 , Tim Wescott wrote:> On Tue, 21 Aug 2012 10:43:35 -0700, f.quivira wrote: > >>> I'm an antique. What is "ECE"? >> ECE means Electrical and Computer Engineering. It's a dual major program >> :) >> >>> However, back in the 60's I was a BSEE student working as an >>> electronics tech for the university's veterinary physiology department. >>> We had lousy EEG and EKG signals that I could never filter >>> successfully. Understood years later why it is better to "prevent >>> interference" than to "ATTEMPT to REMOVE interference". >> >> What do you mean by preventing interference? Does that mean having >> shielded wires going from the electrodes to the data acquisition system? >> Or does that mean to have hardware analog filters before sampling is >> done? > > Hardware analog filtering is just attempting to remove interference in > the analog domain rather than digital. > > He means shielded wires, or balanced wires, or whatever it takes to keep > the 60Hz from getting into your electronics in the first place. >That ain't so simple: The capacitance of a person to the active phase of the mains power is of the order of 20 pF, and the capacitance to ground is of the order of 200 pF, which creates a high-impedance 1:10 voltage divider feed from the 60 Hz (or 50 Hz on this side of the pond) power signal. The trick for a successful capture of a biosignal (EEG, EKG, EMG etc) is to use a differential input amplifier. The contact impedances to the actual signal source are quite high, and very probably unbalanced. To keep an useful CMRR, the input impedance to the pre-amplifier must be very high, including a very small effective capacitance. The cables have to be shielded to keep most of the crud out, but the shields usually need bootstrap feedback from the amplifier, to keep the input impedance high enough. For patient safety, the input amplifier should be totally floating, with pretty small leakage capacitances to the ground. I'm of the same opinion as the other posters: - the main way to handle with the hum is to prevent it from entering, - the way to filter the hum with harmonics is a comb filter, but you have to be prepared for appreciable signal distorsion. Been there, done that - I built EKG equipment for intensive care in the 70's. -- Tauno Voipio
Reply by ●August 21, 20122012-08-21
On 8/21/12 3:03 PM, maury wrote:> > Get a copy of a book by Widrow and Stearns titled Adaptive Signal Processing. In there you will find a section titled "Cancelleing 60-Hz Interference in Electrocardiography". Your library should have a copy, or can get one easily. Be sure to check with your prof to see if (s)he wants you to go this route to clean up the signal. >ECG and speaker-phones were, i believe, the original two applications of Widrow's LMS filter. back in the '90s (maybe '92), the AES convention in SF had Widrow as an invited speaker and he brought up both of these applications. it was a good talk. you use the actual line voltage as the "desired signal" that you're trying to cancel. if the line voltage is too smooth (not enough harmonic energy), you might want to jazz it up a little by running it through a slight non-linearity to generate harmonics so the LMS has something to cancel. but, if a 60 Hz notch filter works to get the fundamental, try a sharp comb filter to get it and the harmonics. if you sample the line voltage anyway, you can use that to "pitch track" to make sure the notches of your comb are positioned right-on-the-money. you can make the notches as slim as you want. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
Reply by ●August 21, 20122012-08-21
Richard Owlett <rowlett@pcnetinc.com> wrote: (snip)> I'm an antique. What is "ECE"?Around here (Seattle) it is Electrical and Computer Engineering. What many people think of as Computer Science is more Engineering, and belongs in an Engineering department. Computer Science, then, is closer to Math, maybe part of the Math department.> However, back in the 60's I was a BSEE student working as an > electronics tech for the university's veterinary physiology > department. We had lousy EEG and EKG signals that I could > never filter successfully. Understood years later why it is > better to "prevent interference" than to "ATTEMPT to REMOVE > interference".-- glen






