1
$\begingroup$

EDIT: Based on a comment below, this might actually be a two-level PWM, rather than simply ASK. Frankly, I don't really know, but any decoder blocks that folks are aware of for any of these basic coding types would be of interest--after all, I'm playing and learning, and won't be trying to open my garage door this way anyway!


I'm playing with GNU radio companion (still pretty new to it), and recently took a look at the signal from my garage door opener. I could see "stuff" flash past on the QT gui sink. I was also able to write a file full of signal amplitude values, and wrote a simple python program to create a static/snapshot waveform display which rendered this as a square wave with varying mark-space ratios quite nicely.

However, what I'd like to do is decode the pulse lengths, probably into a binary representation, in GRC. This would seem likely to be something that's been done before, but I cannot find anything in the core blocks that mentions ASK, nor did I find anything in the out of tree repository I came across.

Am I missing something? Is there another name for amplitude shift keying that I should use for my search perhaps?

$\endgroup$
4
  • 1
    $\begingroup$ sure it's ASK, not OOK or PPM or PWM? $\endgroup$ Commented Oct 27, 2021 at 14:43
  • $\begingroup$ Well, I might have the terminology wrong. The signal is a simple carrier that turns on and off. The turned-on signal seems to have two distinct durations, which appear to represent ones and zeros. Michael Ossmann seemed to call that ASK, but I'll go with whatever :) $\endgroup$ Commented Oct 27, 2021 at 16:29
  • 2
    $\begingroup$ ASK happens when the keying is done through the change of an amplitude (and for that reason, OOK, on-off keying, might be called a special case of ASK) :) What you describe would indeed a binary pulse width modulation! Cool stuff :) $\endgroup$ Commented Oct 27, 2021 at 17:39
  • 1
    $\begingroup$ As a suggestion, I'd first pursue OOK. Most seem to be OOK. If you look up the FCC number in the FCC database there should be an implementation explanation. :) That will make decoding much easier. $\endgroup$
    – David Hoelzer
    Commented Oct 27, 2021 at 19:41

1 Answer 1

3
$\begingroup$

This can be done in a number of ways, but a quick and easy one is (as you build this, attach Qt GUI time sinks as you go along to see what effect each block has!)

  1. Convert your signal to its squared magnitude (remember, you're dealing with complex numbers, so that an "active" carrier is a rotating, constant-amplitude pointer in the complex plane), since we do not care about phase.
  2. Say your sampling rate is $f_s$, and a typical short on-time is $N$ samples, so duration would be $N/f_s$; then, use a low-pass filter block on that float stream. Cutoff frequency would be something, say, higher than 3 times the inverse of the duration, so $3\cdot f_s / N$. Now you've got a slightly rounded, but low in noise, waveform. If it seems "too round", increase the cut-off frequency. (But roundness definitely doesn't hurt much, as long as you can still tell long and short apart.)
  3. Use the threshold block to divide it into an "off and on only" signal.
  4. Use a moving average block with a length that contains a symbol duration (so probably something like "long on number of samples + inter-symbol guard time"). You'll notice that its output will be higher for long-on, short-off periods, and lower for short-on, long-off periods.
  5. Use another threshold to tell these values apart as 0 or 1.
  6. Use a keep-m-in-n to only keep one of these per symbol.
$\endgroup$
1
  • $\begingroup$ This looks great. I'll give this a go and get back! $\endgroup$ Commented Oct 28, 2021 at 14:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .