Finding BPM of a heartbeat using Fourier Transform

2019-03-03 20:41发布

This question already has an answer here:

I have a plot of the fourier transform of a signal. The fourier transform of the signal is plotted vs. its index numbers. I am given the sampling frequency (Fs) and the total number of samples (N), as well as the indices for the two largest peaks in the sample. I am looking to find the beats per minute of the signal with this information. My first guess would be that it is the total number of samples divided by the index of the largest peak (N/(largest index). However, I feel as though something should be done with the second maximum peak. I am confused on where the indices come into play. Any help would be appreciated.

1条回答
▲ chillily
2楼-- · 2019-03-03 21:17

The Discrete Fourier Transform for real input data has some symmetry: X_{N-k} = X*_{k}. I assume your peaks obey this relationship. So, only the first N/2 points are relevant and you are only able to detect frequencies lower then Fs/2, because if you sample at a frequency of Fs a sinus with frequency of Fs/2, you can not see the difference between this sinus and a constant.

BPM = (largest_index - 1)/N * Fs * 60

Note that -1 is need because the first element corresponds with a zero frequency (i.e. constant value).

You can always check your code by manually determining the peak between two heartbeats are by validating your method with a generated signal with known frequency.

查看更多
登录 后发表回答