Electronic – arduino – An audio jack modem

adcarduinoaudiofft

I'm looking at controlling Arduino by reading audio commands sent from a raspberry pi (through javascript). I've found the SoftModem code and wonder how it works. It claims that "It uses the phone's audio jack and Bell 202 modem-like FSK encoding", but I wonder how it's done. Doesn't it need to sample the ADC and apply some filtering like FFT? I can't seem to find where all this is done.

Any thought appreciated.

Best Answer

A radio communication system that had to work in margin signal to noise ratio conditions would need to digitise the signal, filter, possibly FFT (usually not), track clock phase, error correct, all that tedious stuff.

However, with a high signal to noise ratio wired connection, this cheap'n'cheerful library uses the analogue comparator to detect when the signal crosses a threshhold, and the timer to measure the length of the high/low periods instead. Sampling happens implicitly in the wait for start bit, wait for data bits, wait for stop bit functions comprising a get data byte state machine for instance. Filtering? We don't need no steenkin' filtering!

Read the source code, it's all in SoftModem.cpp that you linked to.