# Uniform noise signal

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)
%total data time (ms)
%Point in time where there is a max point
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)

• Ever hear the saying "garbage in, garbage out" – user28715 Aug 28 '17 at 18:18
• you want to find the dominant rhythm? – Mohammad M Aug 28 '17 at 19:08
• Partially. As of right now all my team and I are wanting to see is the full range of BPMs over the course of the experiment. We are trying to figure out if we are seeing the noise from the sensors collecting the raw data or if it needs to be treated differently before feeding it into the FFT. – TxAg Aug 28 '17 at 19:13
• you are taking fft after event detection, and not from your measured signal. your event signal is like a delta train (with unequal distance) which exactly has this kind of spectrum. to find bpm find the distance between each event in second then find its inverse and multiply it by 60. – Mohammad M Aug 28 '17 at 19:21