Question

I would like to make a program that can transfer data as pulses of a certain frequency but am unsure on how to detect if a frequency is present.

I would assume I need to filter out all unneeded frequencies but I can't seem to find anything on how to do this.

Are there any libraries that already do this or would I have to build my own? Are there any examples of this or something similar being done?

Was it helpful?

Solution

It looks as though you're trying to implement a Modem, and would be well advised to look at the proven modulation techniques used for this purpose - usually QPSK and QAM. The technique you imply in your question is a crude from of amplitude modulation - essentially modulating a carrier of a given frequency with a bit-stream. Heterodyning might be a good place to start when demodulating this. Using an FFT will yield poor results because of the sampling effect of windowing, which will result in a poor bandwidth.

Another practical problem you will face once you've demodulated the signal is clock recovery. It is highly probable that the original bitstream clock will be asynchronous with the sample clock at the receiver. In order to decode the data-stream, you will need to recover the sender's clock (that is to say, the relationship between it and a local clock). A Phased Lock Loop is the usual way of achieving this.

You will also need to work out how to detect the start of the bit-stream - e.g. some kind framing.

OTHER TIPS

You'll want to apply a Fourier transform to the signal data to look it in the frequency domain. JTransforms is an open source library you can use to do that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top