- 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?
Noise in ECG data
35 ビュー (過去 30 日間)
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??
回答 (6 件)
Rick Rosson 2011 年 7 月 20 日
- 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?
Here is some improved code:
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));
for k = 1:P
title(['Time Domain and PSD for Channel #' num2str(k)]);
spec(1) = fdesign ...
spec(2) = fdesign ...
filt(1) = design(...);
filt(2) = design(...);
y = filter(filt(1),x);
z = filter(filt(2),y);
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?
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);