ECG spectrum wrong?
Mostrar comentarios más antiguos
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.
Respuesta aceptada
Más respuestas (3)
Daniel M
el 29 de Oct. de 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 comentario
Stephan Lallinger
el 1 de Nov. de 2019
Stephan Lallinger
el 29 de Oct. de 2019
0 votos
Stephan Lallinger
el 1 de Nov. de 2019
4 comentarios
You may want to post this as a new question so more people can see it. But I have a few comments.
For your bandpass filter, try this
data = detrend(data); % remove the mean
[B, A] = butter(4, [0.5/(fs/2) 150/(fs/2)]);
filt_data = filtfilt(B,A,data);
As for notch filters, I either use the code I posted above, or the function ft_preproc_dftfilter() in the Fieldtrip toolbox. (It uses a similar approach to yours, which I'm not familiar with, so your issue could be something small.)
But your issue might be aliasing. What is your sampling frequency? If it is under 300, that could cause an issue with filter at 150 Hz.
Stephan Lallinger
el 2 de Nov. de 2019
Daniel M
el 2 de Nov. de 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
el 2 de Nov. de 2019
Editada: Stephan Lallinger
el 4 de Nov. de 2019
Categorías
Más información sobre Bartlett en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!