ECG spectrum wrong?

4 vues (au cours des 30 derniers jours)
Stephan Lallinger
Stephan Lallinger le 27 Oct 2019
Hi all,
I have a question about an EKG spectrum.
Someone gave me this ECG spectrum for an exercise.
I'm not sure but the spectrum looks weird.
You clearly see a 50 Hz tone and its harmonics.
The whole thing looks like a modulation.
I would say there was no anti aliasing filter used.
Or does an ECG spectrum with 50 Hz + harmonics look like that?
Thanks for the help.
Best Regards.

Réponse acceptée

Daniel M
Daniel M le 27 Oct 2019
I'd say it looks fairly normal once you notch filter the line noise. But there is other preprocessing to do, like a low pass filter. You would probably get a lot out of this article <https://www.ncbi.nlm.nih.gov/m/pubmed/20851409/>
  1 commentaire
Star Strider
Star Strider le 27 Oct 2019
+1 for the PubMed citation!

Connectez-vous pour commenter.

Plus de réponses (3)

Daniel M
Daniel M le 29 Oct 2019
I'm not sure how you're doing your notch filters, but try this:
Fs = 625; % or whatever your sampling frequency is.
Fn = Fs/2; % Nyquist frequency
numHarmonics = 4; % Let's do 50, 100, 150, 200, 250
lineFreq = 50; % Hz
for fq = ((0:numHarmonics)+1) * lineFreq
Fl = fq + [-1, 1]; % notch around Fl. Could try [-2, 2] if too tight
[z,p,k] = butter(6, Fl/Fn, 'stop');
sos = zp2sos(z,p,k);
data = filtfilt(sos, 1, data); % assumes data is [time x ... dimensions]
% overwrites data, and filters sequentially for each notch
end
  1 commentaire
Stephan Lallinger
Stephan Lallinger le 1 Nov 2019
Thank you for your code.
I tested several preprocessing steps last week.
Now iam using an IIR highpass and FIR lowpass (0.05 Hz - 150 Hz).
For power line noise i tried a comb notch filter.
I will test your code also, thank you for that!

Connectez-vous pour commenter.


Stephan Lallinger
Stephan Lallinger le 29 Oct 2019
Thank you for your help.
Now i'am using an IIR HPF and a FIR LPF.
Iam not happy with the notch filters. Now i try to implement an adaptive filter for line noise.
Thank you!

Stephan Lallinger
Stephan Lallinger le 1 Nov 2019
Hi,
sorry again i got a question again about preprocessing.
For simplicity, an ECG with a noise at only 50 Hz.
In my picture you can see that the Notch filter distorts the ECG in the QRS complex.
I use a 150 Hz low pass filter, with a lower cut-off frequency I get the error off, but I want to stay at 150 Hz.
Here's the notch I use:
%%noise to filter
f_noise = 50;
%%normalize frequency
f_notch = f_noise/fs;
%%place zeros
N =[exp(j*2*pi*f_notch);exp(-j*2*pi*f_notch)];
%%place poles with same angular as zeros
%%distance to unit circle
P = 0.5*N;
%get coefficients
b = poly(N); a = poly(P);
Is there a technique to reduce this afterswing, except for a lower cutoff frequency of the low-pass filter?
I can imagine it is due to the phase response and the associated group delay.
Best regards.
  4 commentaires
Daniel M
Daniel M le 2 Nov 2019
Ok good idea to open a new question. I will look out for it, and see if others can give advice too. In the meantime, think you could post your data here? I'd like to tinker with it a bit.
Stephan Lallinger
Stephan Lallinger le 2 Nov 2019
Modifié(e) : Stephan Lallinger le 4 Nov 2019
Of couse i can it is excel. I hope this is fine.
fs = 500 Hz;
for reading i use:
ecg_signal = xlsread( 'mySigXx.xlsx');
First signal contains 50 Hz + harmonics.
Second signal is with the ringing effect when notch is used.
EDIT: for second signal you need to add 50 Hz noise.
I do it like this
fs = 500;
Ts = 1/fs;
t=0:1:length(ecg_signal)-1; %time vector depending on ecg signal
t = t/fs; %normalize time vector
ecg_signal = ecg_signal' + 0.5*sin(2*pi*50*t); % add Noise

Connectez-vous pour commenter.

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by