So, here is how I manage data flow through my SDR recorder. It’s all about objects.
Several folks have asked how I am storing two channels of radio data in my software defined radio recorder. Before I get into the actual saving, I thought a quick look at how I manage data flow was in order.
In most cases, your radio will output a lot of bytes very quickly. For example, if you are sampling at 250,000 samples per second with 16 bit I/Q channel data, a dual channel SDR provides 8 million bytes in a second. Normally, data is sent in frames or packets. With the Afedri, each packet is 1024 bytes or 32 samples.
For my software, I process radio data in blocks of 1024 samples at a processing rate of 25,000 samples per second for filtering and demodulation. So, if I am sampling at 250,000, I need to decimate this data by a factor of 10. This means collecting 10,240 samples before decimation. Collecting this much data takes around 40 milliseconds.
To manage data flow, I need to turn the stream of bytes into processing blocks. My standard data carrier is an object, shown above. My input routines aggregate and translate the data into two channels, A and B. My object also records its size, the type of data, sampling rate and frequency. Data types can be 8, 16 or 32 bits, integer or floating point.
I also have routines to change data into different formats as we proceed.
Managing Data Flow with Threads
Another feature is that each object contains a section called Processing Parameters. These are set every time a new block of data is created. My parameters are simply instructions that tells the rest of the program all it needs to process the data in different ways.
Since my software does its work in a pipeline of worker threads (or separate processing blocks), it is critical not to access the data or parameters from the main program while the magic is taking place. By saving the parameters with the data before the pipeline starts its processing, I avoid any conflicts. Quite simple, actually, and works well.
Next, I will describe how the data is saved to file and played back later.
My head is spinning reading your simple explanation. Still, it’s all black magic to me, John! Keep pushing the envelope!