Tell me more ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

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?

share|improve this question
3  
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
1  
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

2 Answers

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.

share|improve this answer
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

FFT is overkill. Use the Goertzel algorithm to detect a single frequency.

This effectively implements a second-order IIR filter with poles at e + 2πiω and e − 2πiω, and requires only one multiplication (assuming 2cos(2πω) is pre-computed), one addition and one subtraction per input sample. For real inputs, these operations are real.

"My communication is very simple, if the frequency of the portant is present this is a 1, if not, is a 0."

This is called on-off keying. I'm not sure if Goetzel is the optimal method for demodulating this in digital, but at least one person recommends it.

share|improve this answer
Thanks for the hint, the Goertzel algorithm seems very simple and efficient. I will make a try! – Katte Jun 8 '11 at 6:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.