Noise in ECG data
이전 댓글 표시
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.
But the ECGs are still suffering from some humming noise. So when I plot the data on Matlab, I got all forms of zig-zags.
I want to know is it possible that fft of the signal is taken and noise is removed, that is those frequency components can be removed from them in Matlab??
I got the fft spectrum, but the plot does not show the frequency information related to samples...How I will extract the frequency info??
Thanks.
댓글 수: 1
Sean de Wolski
2011년 7월 20일
Can you show us what you've done and supply a small set of sample data?
답변 (6개)
Rick Rosson
2011년 7월 20일
0 개 추천
Hi Talha,
- Do you know the sampling rate of the signal?
- Also, what is the size of the time-domain representation (how many rows and columns)?
- Can you please show us your MATLAB code?
Thanks.
Rick
Rick Rosson
2011년 7월 21일
0 개 추천
Hi Talha,
- Why are you using low-pass and band stop filters? Why not use two band-stop filters?
- Is the noise you are trying to remove related to 50 Hz electrical power? Is it the fundamental (50 Hz) and the second harmonic (100 Hz) of the electrical power supply? If yes, have you considered using two notch filters, one at 50 Hz and the other at 100 Hz?
- How did you design the low-pass and band-stop filters? Did you use the FDATool, MATLAB filter design function calls, or some other method? If you designed by function calls, can you please post your filter design code?
- Can you please post the filter coefficients for both filters?
- How did you apply the two filters? Can you please post your filter application code?
Thanks!
Rick
Rick Rosson
2011년 7월 21일
Hi Talha,
Here is some improved code:
%%Computations:
x = d;
[N,P] = size(x);
Fs = 500;
dt = 1/Fs;
t = dt*(0:N-1)';
dF = Fs/N;
f = (-Fs/2:dF:Fs/2-dF)';
X = fftshift(fft(x))/N;
Xpsd = 20*log10(abs(X));
%%Plotting:
for k = 1:P
figure;
subplot(2,1,1);
plot(t,x(:,k));
subplot(2,1,2);
plot(f,Xpsd(:,k));
title(['Time Domain and PSD for Channel #' num2str(k)]);
end
%%Filtering:
% Specify:
spec(1) = fdesign ...
spec(2) = fdesign ...
% Design:
filt(1) = design(...);
filt(2) = design(...);
% Filter:
y = filter(filt(1),x);
z = filter(filt(2),y);
Rick Rosson
2011년 7월 21일
0 개 추천
Everything that you are doing looks correct, as far as I can tell. When you say that "Passing through the filters causes ripples", what exactly do you mean? Are you seeing "ripples" in the time domain signal, or in the frequency domain representation? Can you please post one or more screen shots showing the signal before and after passing through the two filters?
댓글 수: 7
Talha
2011년 7월 22일
Rick Rosson
2011년 7월 22일
1. Are you seeing the ripples in the time domain or the frequency domain?
2. People have been posting screen shots to other web locations, and then providing links to the images.
3. Yes, you can use moving average or adaptive filters, but I do not know if they will help or not.
Talha
2011년 7월 22일
Rick Rosson
2011년 7월 22일
Are you sure that the sampling rate Fs really is 500 samples per second? The only explanation I can think of is that the sampling rate you are using to design the filters is different from the sampling rate of the source signal.
Talha
2011년 7월 25일
Rick Rosson
2011년 7월 25일
Yes, that could very much affect the results. Please try designing your filters for Fs of 250 samples per second, and then reapplying them to the signal. That might do the trick.
Talha
2011년 7월 26일
Bjorn Gustavsson
2011년 7월 26일
Talha, what is the noise you're after in your original image? Is it the point-to-point variation? If so you should be fine with a very simple low-pass filter, something you'd need to use only matlab's filtfilt or filter functions. Something like this:
I_filtered = filtfilt([.5,1,.5]/2,1,I_original);
HTH
댓글 수: 2
Talha
2011년 7월 26일
Bjorn Gustavsson
2011년 7월 26일
I don't know enough about ECG-signals to know what is "true" ECG signal and what constitutes base-line variations. But considering that you only show us ~2 periods it might be completely impossible to determine. I suggest you could do something similar to conditional integration - but here rather "conditional resampling" (I just made that one up.):
Identify the peak of the spikes (the ones at ~2690 and 2950 and so on) then resample/interpolate something like this:
iPeaks = find-local-peaks(ECG);
for i1 = 1:(length(iPeaks)-1),
iCurr = iPeaks(i1):iPeaks(i1+1);
ECGresampled(i1,:) = interp1(t(iCurr),ECG(iCurr),linspace(t(iCurr(1)),t(iCurr(end)),nS);
end
That should give you a 2-D matrix with the individual ECG-periods along the rows and might give you some view of variations in base-line variations that are way slower than one ECG-period. How to determine what is ECG-signal and what is base-line variations in a single period I would not like to tell! Maybe this flutter is a heart condition but not that one over there...
haneen
2014년 2월 1일
0 개 추천
hi , i am haneen my broject (removes the baseline wander in ecg signal by using wavelet transform) so, i need code in matlab to do this, thanks
카테고리
도움말 센터 및 File Exchange에서 Single-Rate Filters에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!