Simple ASK demodulation in software?
November 30, 2006 11:23 PM   RSS feed for this thread Subscribe

I have an audio signal containing very simple amplitude shift keyed data . Is there any cross-platform software I can use to extract the data? Or pointers to an explanation I could use to write my own?

The Polar heart rate monitor I have can transfer data to a computer via chirping into the microphone, but the software for it is Windows-only, and pretty limited in what it can do. The chirping is an on/off keyed signal, and if I could just get at the digital data, I'm pretty sure I could decode most of it, since the protocol for an earlier model of the watch has been reverse engineered. But I'm stuck at the audio decoding stage. If I look at the waveform, it's obvious that I could do it by hand--just chunk the waveform into slices the size of a pulse, and write down a 1 for each slice that contains a signal and a 0 for each one that contains no signal. But that would take forever.

I'm looking for software that can examine the waveform and turn it into 1s and 0s for me. Or if there's a well-explained algorithm I could use to write my own software, I'd be just as happy with that.
posted by hades to computers & internet (6 comments total)
I don't know any program to automatically handle it, but it shouldn't be too bad. Your sound data is digital samples, meaning it exists as a series of numbers each describing the voltage of the signal at a single instant. Each number is called a "sample"

First is the problem of chunking the data into slices. You should be able to see the bit time easily (minimum time a signal must stay at one level without changing), and just manually pick the first transition as the start point for cutting the data up. Maybe graphically examine the rest of the signal with the chunks displayed to see that it lines up throughout.

Then your program (or MATLAB script, if you've access to that) decides if each chunk is a one or zero. Depending on how clean your signal is, you might be able to just look at the maximum absolute value of all the samples, and compare to a threshold x. If >x, the bit is a 1, if <x, the bit is a 0. That may not work, so you might go on to try something called the Mean-Square value- square each sample's value, take the average over the entire bit time, and compare that value to a threshold. Keep in mind that the presence of a signal could mean either a 1 or a 0, so flip all the bits if you get gibberish.
posted by TheOnlyCoolTim at 11:55 PM on November 30, 2006


You could try this binary decoder. In reality you have a signal which looks like RS232 or equivalent. There are many pieces of software available to read and interpret that form of data, determine which protocal was used.
posted by ptm at 12:09 AM on December 1, 2006


You could certainly do it with MATLAB, but it's expensive.
Octave is a free alternative.
posted by rom1 at 12:39 AM on December 1, 2006


Yeah, go ahead and pick up the Python code thats been put to glue together components of GNU Radio. Its the closest to what you're looking for.
posted by effugas at 1:02 AM on December 1, 2006


This perl program does a similar task, but for a different modulation scheme (frequency shift keying.) I'd bet it could probably be pretty readily adapted (i.e., from detecting transitions between high frequency and low frequency to detecting transitions between some frequency and no frequency.)
posted by blenderfish at 1:35 AM on December 1, 2006


In reality you have a signal which looks like RS232 or equivalent.

I don't think so. RS232 signals aren't modulated - they have either a high or low voltage level. This is a modulated signal - it's a sine wave, with two levels of amplitude, in this case one level being zero.
posted by TheOnlyCoolTim at 10:21 AM on December 1, 2006


« Older What sort of weird and wonderf...   |   My computer was stolen, I used... Newer »
This thread is closed to new comments.


Related Questions
How does autotune work? October 22, 2007
My ears! My ears! September 17, 2007
How do I shot dsp June 4, 2007
What is the command string or path for forcing... March 22, 2006
How invented DSP convolution? July 7, 2005