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?
|
|
|||||||||||||
|
|
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. |
|||||||
|
|
FFT is overkill. Use the Goertzel algorithm to detect a single frequency.
"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. |
|||
|