Skip to content

Instantly share code, notes, and snippets.

@nickrobinson
Last active November 25, 2019 12:58
Show Gist options
  • Select an option

  • Save nickrobinson/095a92b14fce8ded6ab252c0327ffeea to your computer and use it in GitHub Desktop.

Select an option

Save nickrobinson/095a92b14fce8ded6ab252c0327ffeea to your computer and use it in GitHub Desktop.
Kerberos SDR Notes

Kerberos SDR Notes

Programs

C

rtl_daq

Overview

rtl_daq is responsible for capturing and passing IQ data from each of the 4 receivers on the Kerberos SDR to additional stages. In the case of the Kerberos SDR code example rtl_daq passes IQ data straight to the sync application.

Inputs

Input can be sent to the rtl_daq program by writing to a particular FIFO queue (_receiver/C/rec_control_fifo).

  • Reconfigure ('r')
    • A user can reconfigure the settings on the underlying SDR by passing an 'r' character to the rtl_daq FIFO queue along with the settings they want to update. Below is a Python example of doing this.
from struct import pack, unpack

class KerberosController():
    def __init__(self):
        self.rec_control_fifo_name = "_receiver/C/rec_control_fifo"
        self.rec_control_fifo_descriptor = open(self.rec_control_fifo_name, 'w+b', buffering=0)
        self.reconfig_tuner_byte = 'r'.encode('ascii')

    def update(self, center_freq, sample_rate, gain):
        self.rec_control_fifo_descriptor.write(self.reconfig_tuner_byte)
        self.rec_control_fifo_descriptor.write(pack("I", int(center_freq)))
        self.rec_control_fifo_descriptor.write(pack("I", int(sample_rate)))
        self.rec_control_fifo_descriptor.write(pack("i", int(gain)))
        self.rec_control_fifo_descriptor.write(pack("i", int(gain)))
        self.rec_control_fifo_descriptor.write(pack("i", int(gain)))
        self.rec_control_fifo_descriptor.write(pack("i", int(gain)))

kc = KerberosController()
kc.update(94500000, 2000000, 50)

  • Kill ('2')
from struct import pack, unpack                                                                                                                                                                                    

rec_control_fifo_name = "_receiver/C/rec_control_fifo"                                                                                                                                                
rec_control_fifo_descriptor = open(rec_control_fifo_name, 'w+b', buffering=0)
rec_control_close_byte = pack('B',2)
rec_control_fifo_descriptor.write(rec_control_close_byte)
Executing
sudo chrt -r 50 ionice -c 1 -n 0 ./_receiver/C/rtl_daq 256 2>/tmp/log_rtl_daq

sync

Overview

The sync program accepts the raw IQ stream coming in from the rtl_daq program. The sync then takes care of applying offsets to each of the incoming IQ values from each receivers based on a set of delay parameters. These parameters can be modified by a user by passing a different set of delay values to this application via its FIFO queue (_receiver/C/sync_control_fifo)

Inputs
  • Update Delay Values ('d') A user can update the current set of delay values for the sync program by passing in the character d along with an updated set of 4 delay values (1 for each receiver).

gate

Overview

The gate program is used to limit the rate of samples received by a consumer program ingesting IQ data from the Kerberos SDR. This application requires a user to write a character to its FIFO queue (_receiver/C/gate_control_fifo) each time a user wants the program to write a set of values via stdout.

Inputs
  • Write values to stdout (1)
  • Exit (2)

Hydra

Signal Processor

https://github.com/rtlsdrblog/kerberossdr/blob/master/_signalProcessing/hydra_signal_processor.py#L265

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment