OOK Transmitter in C

Hi All

I am a complete noob as far as the limesdr h/w and tools are concerned.
I have spent the weekend running small examples on the LimeSDR-Mini

my goal is to produce an OOK transmitter, and I was hoping to use the following as my starting point for the basicTX

If my reading is correct this example is actually modulating the carrier as opposed to switching on/off

If I had the following requirements, what should I be looking at
Transmit frequency 500Mhz
OOK data rate 500kb/s

any help or guidance appreciated.

I’m kind of new too but will try to help.
This example sets up your device and then transmits the data in the buffer repeating for 10 seconds.

With LMS_SendStream(…) the data passed in tx_buffer get’s stored in a Ring buffer (see FIFO.h), and as soon as the TX thread started by LMS_StartStream gets CPU time, some samples in the buffer will be sent by the hardware (see TransmitPacketsLoop() in Streamer.cpp).
So a it’s kind of OOK, because it will only send when the tx thread gets CPU time. The carrier will be there constantly.

Hope that helps for a start.
Also if I am wrong I hope some of the experts here will correct me.


Hi Martin

thanks for responding.
Maybe I am totally misunderstanding, but I assumed the values in the tx_buffer define a sine wave (tone frequency) modulated onto the carrier
const double tone_freq = 1e6; //tone frequency

So in other words, is this not producing a 500Mhz carrier with a 1Mhz Amplitude Modulation ?

Whereas I am not looking to modulate the carrier, but simply to ‘gate’ the carrier On/Off


Yes, you are right, kind of went overboard with the tx thread stuff. The tx_buffer only holds the 1MHz tone. And if you run the test the device will send the 500MHz carrier and the 1MHz tone.

What I wanted to point out is that in order to switch the carrier on and off, you will probably need to look into modifying the LimeSuite code. Just writing a userprogram will afaik not be enough.



If you’re still looking into getting a OOK, maybe these tutorials could help.
I know that ASK != OOK, but still.


Hi Martin
I am !
Thanks for the pointers, I had ‘scan’ read these a few days ago, and didn’t think they were directly relevant, I will take a more detailed look at what is in there.
By relevant, I meant, including any reference code I could use as a my starting place.


@LMPA66 OOK, Ok, don’t know why you are using OOK, doesn’t matter. Off, send I/Q values 0. On 1 if I/Q values are F32, 0xffffh if I16. Encoding a binary value will just require 1 I/Q pair per bit.

Something like;

value is 8 bit
 buff is 16 bit, 8 element complex buffer

buff[1] = buff[0] = (value&0x80) ? 0xffff : 0;
buff[3] = buff[2] = (value&0x40) ? 0xffff : 0;
buff[5] = buff[4] = (value&0x20) ? 0xffff : 0;
buff[7] = buff[6] = (value&0x10) ? 0xffff : 0;
buff[9] = buff[8] = (value&0x08) ? 0xffff : 0;
buff[11] = buff[10] = (value&0x04) ? 0xffff : 0;
buff[13] = buff[12] = (value&0x02) ? 0xffff : 0;
buff[15] = buff[14] = (value&0x01) ? 0xffff : 0;

You get the idea? I haven’t tested this myself though.

Hi Matt,
This was what my expectation was. I was guessing that simply to send an OOK signal would be something like this, and this makes perfect sense.
I will try this shortly
Many thanks for clearing up the blumin’ obvious