# Extracting the power of a frequency range in a signal

I have a heartrate signal which is a few hours long. I need to preform a spectral analysis to get the ratio high frequency (0.15Hz-0.4Hz) to low frequency (0.04Hz - 0.15Hz) changes in heartrate within a window.

Maths is not my natrual habitat, but am I right using an FFT and and summing the absolute values of the bins that lie inside my frequency range?

I don't expect a full blown explanation of how fft works, but links to any tuts would be nice. I know what an FFT does, I just don't know how to use it.

-
You're on the right track. You'll want to sum the squares of the magnitudes, though. But before we get too far ahead of ourselves, what's the ultimate objective and how large is each window? –  cardinal Mar 17 '11 at 12:55
The window is a changable paramater, but I'll make sure it is larger than twice the period of the lowest frequency. The ultimate goal is to plot the ratio of the magnitude of HF to that of LF, over time. –  Hannesh Mar 17 '11 at 13:41
The size of the window you'll want will be related to the frequency resolution you desire when adding up the power in each band. Longer windows mean better frequency resolution, which means you'll be able to separate the two bands better. Also you'll have other issues to contend with like spectral leakage if the data have noise and/or are not properly preprocessed. What's the sampling rate? If all you are interested in is the power and not the phase, filtering with two separate bandpass filters would be simple and work well. But it looks like you want to know how the ratio varies with time. –  cardinal Mar 17 '11 at 13:53
The spacing of the data points isn't uniform, but I'm interpolating to get a uniform sample rate. Each data point contains the time between two succesive heartbeats. So the faster the heart, the more data points. Someone who is stressed will have more high frequency fluctuations in their heartrate than if they are calm. So I need the ratio of high freq fluctuations to the low freq ones. I'm a bit puzzled about the plot of the FFT, if it represents frequency domains, why is it symetrical? How do I find out the frequency range of (say) the third FFT bin? –  Hannesh Mar 17 '11 at 14:21
This sounds like a different problem than you originally described. So, you're only recording the time of each heart beat? Say, using a threshold detector? You don't actually have true EKG data? –  cardinal Mar 17 '11 at 14:34