# Power line communication, how to check if frequency is present

I'm trying to communicate on a power line without external filters (only a filter for the 50/60Hz), because I want to use only digital filters.
My processor is a Cortex-M3 device running at 24MHz.
My communication is very simple, if the frequency of the carrier is present this is a 1, if not, is a 0. Obviously I will use a start bit for sincronization.
The frequency of the carrier is 125kHz.
In simple words, I wanna recreate the TDA5051 ASK power-line modem, with software.
I think that there are 2 valid method for doing this:
- Filter the signal with a series of FIR or IIR filters and analize the resulted signal
- Making FFT without filters the signal and check if the portant is present.
What's the best method? There is a best way?

-
FIR/IIR sounds better than FFT - FFT is much more computationally intensive, and wins you nothing if you just need to detect single frequency. Also, you'd need a high order FFT to have the frequency resolution that you can easily achieve with FIR. –  Code Painters Jun 6 '11 at 8:25
It would really help to specify the carrier frequency and the minimum bandwidth required. –  Olin Lathrop Jun 6 '11 at 12:52
As Olin said there is no way to answer without knowing what the frequency of the signal your looking for is. –  Mark Jun 7 '11 at 22:55
I've put the frequency below the Olin post. However, I wanna recreate the TDA5051 ASK power-line modem, in software on a Cortex-M3 running at 24Mhz. The frequency of the carrier is 125kHz. –  Katte Jun 8 '11 at 6:31

As I understand it, you want to detect the presence of a single known frequency. I'm assuming "portant" means something like "carrier"?

A FFT would be huge overkill computationally, and then not get you that good a answer. Why compute the amplitude of many frequencies when all you really care about is a single one? Some sort of band pass filter is better, but it will take a lot of computation to make it tight. A FIR filter will require a very wide kernel to make a tight bandpass, which means lots of storage and computation.

Multiply the incoming signal by the sine and cosine of the frequency you want to detect. Low pass filter each of these to the bandwidth of the signal you want to detect, then square them each and add them. The result is the square of the carrier voltage level. If you need the true linear carrier level, then you have to take the square root of this. However, if you're just detecting on/off keying of the carrier, you can compare the squared value against a threshold.

This method can make arbitrarily tight filters around a particular known frequency. The tightness of the band is a function of the low pass filter applied to the sine and cosine products.

-
Thanks to all for the hints. Yes, I would mean carrier. I wanna recreate the TDA5051 ASK power-line modem, in software on a Cortex-M3. Previously I was wrong, the frequency of the Cortex is 24Mhz, not 72. The frequency of the carrier is 125kHz. –  Katte Jun 6 '11 at 16:31
@user11804 - That's very useful information! Please edit into your question, rather than leaving it in a comment. –  Kevin Vermeer Jun 7 '11 at 21:54
Ok, post edited! –  Katte Jun 8 '11 at 8:50