Detect some frequnecies in a Signal, FFT or Goertzl?

Hi,

If I want to detect an number of frequencies in an input signal, I think, I could either use an FFT or Goertzl’s Algorithm.

I plan to attach a phototransistor in a voltage divider to the ADC of an LPC2138. I will place some beacons which will blink LEDs with a frequency unique to each beacon. The LPC should then be able to identify which beacons it is “seeing” and how strong they are. (In the end I will use 16 phototransitors which look at different directions to estimate the direction to each beacon by the difference of the signal strengh).

My idea is to use at least 10 beacons, preferably 16. So now this means in the end, I will need to detect 16 (10) frequencies for 16 phototransistors.

So, should I rather use FFT or Goertzl?

I also notice both algorithms work one sine waves. Is there a way to use square-waves? And could’t this be much faster (because there are no sine() funktions)?

regards,

Mox

The largest sine-component in a square-wave has the same frequency, so it should be ok.

I would recommend FFT and you probably won’t even have to run it for all frequencies, just the ones you use on the beacons.

Also, you will have to choose the frequencies carefully so that their harmonics don’t introduce false frequencies to your measurements.

Thanks for the reply.

How can I run an FFT for just some freqeuncies?

#edit: I quess You mean that I should do a 16 point FFT and use those 16 frequencies for the beacons?