1

I'm writing an Android app that measures the luminance of camera frames over a period of time and calculates a heart beat using Fourier Analysis to find the wave's frequency. The problem is that my spectral analysis looks like this:

Spectral analysis (y-axis is magnitude, x-axis is index)

which is pretty much the inverse of what a spectral analysis should look like (like a normal distribution). Can I accurately assess this to find the index of the maximum magnitude, or does this spectrum reveal that my data is too noisy?

EDIT: Here's what my camera data looks like (I'm performing FFT on this): Luminance of Current Frame vs. Time

Piglet
  • 29
  • 1
  • 4
  • How are you plotting the output of the FFT ? magnitude ? log magnitude ? – Paul R Nov 05 '15 at 12:17
  • The output of FFT is simply in magnitude, and the x-axis is the index of each peak. – Piglet Nov 05 '15 at 22:13
  • I should note that I am using the JTransforms Java library to perform the FFT on my 1D input. The input is visualized in the bottom graph as brightness values and the output array is shown in the top graph with x being the sample index and y being the magnitude. – Piglet Nov 05 '15 at 22:46
  • What's the sample rate, the FFT size, and are you applying a window function prior to the FFT ? – Paul R Nov 05 '15 at 23:03
  • The sample rate is 12 Hz and I am not applying a window function prior to FFT. The size of my FFT is 100 values. – Piglet Nov 05 '15 at 23:23

1 Answers1

0

It looks like you have two problems going on here:

1) The FFT output often places the value for negative frequencies to the right of the positive frequencies, which seems to be the case here. Therefore, you need to move the right half of the FFT to the left, and put freq=0 in the middle.

2) In the comments you say that you're plotting the magnitude but that's clearly not the case (the magnitude should be greater than 0 and symmetric). Instead you're probably just plotting the really part. Instead, take the magnitude, or Re*Re + Im*Im, where Re and Im are the real and imaginary parts respectively. (Depending on the form of your numbers, something like Math.sqrt(Math.pow(a.re, 2) + Math.pow(a.im, 2)).)

tom10
  • 67,082
  • 10
  • 127
  • 137