Good afternoon. I have some heart monitor data that I am attempting to analyze. I have been given time between the peaks (in milliseconds), and have attempted to reverse-engineer a signal from this using the following code.
clc;
clear all;
%Sampling frequency
Fs = 250;
%total data time (s)
ts = xlsread('12_RR_1.xlsx','G:G');
%total data time (ms)
%total_time = xlsread('12_RR.csv.xlsx','I:I');
%Point in time where there is a max point
xn = xlsread('12_RR_1.xlsx','H:H');
xnt = size(xn);
t = 1:ts;
time = transpose(t);
for i = 1:ts
for j = 1:xnt(1,1)
z(i,j) = xn(j,1);
end
i = i+1;
j = j+1;
end
for i_2= 1:97484
for j = 1:xnt(1,1)
if time(i_2,1) == z(i_2,j)
z_raw(i_2,j) = 1;
else
z_raw(i_2,j) = 0;
end
end
i_2 = i_2+1;
j = j+1;
end
peaks = sum(z_raw,2);
Peaks = abs(peaks);
N = length(peaks);
subplot(2,1,1)
plot(t,Peaks)
title('Raw Data')
subplot(2,1,2)
plot(t/Fs,fft(Peaks,ts))
title('FFT')
This produces a binary signal where y=1 if a peak is detected and y=0 if it is not. However, when I attempted to take the FFT of this it returns a signal with weirdly uniform noise, as shown below.
What's going on--why does a seemingly low-frequency signal have a uniform frequency response? What can I do to my original data (the time between heart impulses) to extract more meaningful information and get a more realistic FFT (high amp low freq data with small amp high freq data)