ecg signal frquency contents

조회 수: 11 (최근 30일)
Mohamad
Mohamad 2018년 6월 6일
댓글: Sandro Lecci 2018년 6월 7일
I need to determine frequncy contents of an ecg signal which i have loaded from a file , but the sampling frequency is Fs=1.0e+04 * 1.7869 I used fft , but when i plot i get frequencies close to zero .
X1=load( ) sig = load(fn) ; sig=x1(:,2); t=x1(:,1); Ls=length(sig); Fs=Ls/t(end)-t(1); I get : Fs=1.0e+04 * 1.7869 Nfft=2^nextpow2(Ls) Y = fft(sig,Nfft)/Ls; f=Fs/2*linspace(0,1,Nfft/2+1); subplot(2,1,2) plot(f,abs(fftshift(Y(1:Nfft/2+1))))

채택된 답변

Mohamad
Mohamad 2018년 6월 7일
Hi code is attached. the signal also attached . Also the figure . I always get on the spectrum very low frequencies components . Thanks
  댓글 수: 2
Sandro Lecci
Sandro Lecci 2018년 6월 7일
Dear Moh,
If I run your code on your data, this is what I get after I zoom in the low frequencies.
As you see, most of the "activity" can be seen <10 Hz. Would you like to extract the sympathetic/parasympathetic activity from it? Then you should first extract the heart rate variability value (calculate the interval between consecutive R-waves) and perform the same analysis (frequency extraction).
Best, Sandro
Sandro Lecci
Sandro Lecci 2018년 6월 7일
Why don't you find the peaks using the findpeaks function?

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Sandro Lecci
Sandro Lecci 2018년 6월 6일
Dear Moh,
I recommend you substract the signal average to get rid of the very low frequencies.
Just write this:
Y = fft(sig-mean(sig), Nfft)/Ls;
Best, Sandro
  댓글 수: 1
Sandro Lecci
Sandro Lecci 2018년 6월 7일
Could you please do the following on your last comment:
-highlight the portion of code -hit the "code button" to display it in a more readable way
I personally do the fft calculation slightly different (I don't use fftshift) but I assume the theory behind is correct. What is strange is the X-axis, it should be centered to zero, which makes your whole spectrum range from 0 to ~500 and considering the properties of an ECG signal you should focus on the low frequencies (LF and VLF) that range < 1Hz.
to calculate the power I do the following:
Fs = 1000; %Hz
xfreq = linspace(0,1, length(signal)/2+1)*(Fs/2); %calculate x frequency vector
tempfft = abs(fft(signal- mean(signal))); %perform fft and extract the real part of it
tempfft = tempfft./length(signal); % divide by the number of samples
tempfft = tempfft.^2; %square it
tempfft = tempfft./xfreq(2); % calculate PSD by dividing by the frequency resolution (second point in the xfreq vector)
myFFT= tempfft(1:end/2+1); % take the first half of it
plot(xfreq,myFFT); xlabel('Frequency'); ylabel('PSD')
Best,

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 ECG / EKG에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by