Hi,
I am trying to use the fft function to compute the power spectrum of an ECG.
ecg=load ('ecg.csv');A=fft(ecg);L=length(ecg); X_mag=abs(A);X_phase=angle(A);fs=350/2; Fbins=((0: 1/L: 1-1/L)*fs).';E=(X_mag).^2;figureplot (Fbins, E)
So far I have done this to create a plot using the data. How do I change the frequency axis to BPM?
Also where and how do I find the average heart rate from this data?
Any help would be much appreciated as I am new to matlab and struggling.
Maybe I should add that to obtain the power spectrum, i need to compute the following equation:
? = |FFT(???)|^2
Best Answer