hi,
I am doing project of ECG acquiring on C5505. I got results successfully on
the PC Application. My ECG results are good and their shape matches those
available on the real ECG machines. And I am writting am algorithm for little
diagnosis.
But the ECGs are still suffering from some humming noise and some inherited
noise. I already implemented digital filters on DSP but in vain.
I have been playing with fdatool. Designing many LPFs and wider notch band
stop filter @ 50 Hz, but all in vain so far. The waveforms are still suffering
from the noise, I know its not 50 Hz cause I tried this scenario and its quite
visible.
Cause no matter what I do the noise still remains there. Although when I plot
them in Matlab, the graphs are all zig-zags. So the diagnostic part becomes a
little harder.
I was wondering is it possible that I can manually remove the noise using fft
and then removing all those specific frequency components in Matlab???
Thanks.
Noise in ECG data
Started by ●July 20, 2011
Reply by ●August 30, 20112011-08-30
Hello,
I once wrote a code that will make a noise template and subtract it from the
original trace.
Although it is written for 60Hz hum noise.
If you have a long enough data, this code might work by just a simple
modification from 60Hz to 50Hz.
Hope this helps.
Kazuo
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [outdata]=humbug(inputdata, fs)
% humbug
% this code will make a hum noise template from inputdata and subtract it
% to make noise-subtracted trace
% Kazuo, Kyoto, 050831
%
% the way it works is
% 1, calculate how many datapoints would correspond 1/60sec
% 2, cut inputdata with that
% 3, make averaged trace
% 4, subtract it from the original trace
unitDataP=round(fs/60);
Tnum=floor(length(inputdata)/unitDataP);
lastfragment=length(inputdata)-Tnum*unitDataP;
% make noise template
avematr=zeros(unitDataP,Tnum);
for i=1:Tnum
avematr(:,i)=inputdata((i-1)*unitDataP+1:i*unitDataP);
end
avetrace=mean(avematr,2);
% make noise trace
plonoisetrace=zeros(length(inputdata),1)';
for k=1:Tnum
noisetrace((k-1)*unitDataP+1:k*unitDataP)=avetrace;
end
noisetrace(Tnum*unitDataP+1:length(inputdata))=avetrace(1:lastfragment);
% subtract noise trace
outdata=inputdata-noisetrace';
--
$BA%1HOBM:(B
$BBg:e%P%$%*%5%$%(%s%98&5f=j(B $B%7%9%F%`%:@8J*3X(B
f...@obi.or.jp
f...@ent.kuhp.kyoto-u.ac.jp
I once wrote a code that will make a noise template and subtract it from the
original trace.
Although it is written for 60Hz hum noise.
If you have a long enough data, this code might work by just a simple
modification from 60Hz to 50Hz.
Hope this helps.
Kazuo
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [outdata]=humbug(inputdata, fs)
% humbug
% this code will make a hum noise template from inputdata and subtract it
% to make noise-subtracted trace
% Kazuo, Kyoto, 050831
%
% the way it works is
% 1, calculate how many datapoints would correspond 1/60sec
% 2, cut inputdata with that
% 3, make averaged trace
% 4, subtract it from the original trace
unitDataP=round(fs/60);
Tnum=floor(length(inputdata)/unitDataP);
lastfragment=length(inputdata)-Tnum*unitDataP;
% make noise template
avematr=zeros(unitDataP,Tnum);
for i=1:Tnum
avematr(:,i)=inputdata((i-1)*unitDataP+1:i*unitDataP);
end
avetrace=mean(avematr,2);
% make noise trace
plonoisetrace=zeros(length(inputdata),1)';
for k=1:Tnum
noisetrace((k-1)*unitDataP+1:k*unitDataP)=avetrace;
end
noisetrace(Tnum*unitDataP+1:length(inputdata))=avetrace(1:lastfragment);
% subtract noise trace
outdata=inputdata-noisetrace';
--
$BA%1HOBM:(B
$BBg:e%P%$%*%5%$%(%s%98&5f=j(B $B%7%9%F%`%:@8J*3X(B
f...@obi.or.jp
f...@ent.kuhp.kyoto-u.ac.jp