kerberos

package
v0.0.0-...-9809d57 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2023 License: MIT Imports: 9 Imported by: 1

README

Kerberos RTL-SDR hz.tools/sdr driver

The Kerberos driver is pretty unique. It's built on top of the rtl driver, except it has 4 SDRs that are tied together to the same lock, to allow coherent RX streams.

There's two built-in helpers, and some code to align the streams using the on-chip RNG to sync clocks. The first will stich together 4 SDRs in adjacent frequencies to a single sample stream at 4x the sample rate. The second will align all 4 on the same frequency, in sample lock for coherent applications.

Format Type U8
Receiver
Transmitter

Documentation

Overview

Package kerberos contains the KerberosSDR driver for hz.tools/sdr

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CoherentReadCloser

type CoherentReadCloser sdr.ReadClosers

CoherentReadCloser is a slice of ReadClosers, which are in sample lock.

func (CoherentReadCloser) Close

func (cr CoherentReadCloser) Close() error

Close will close all the ReadClosers.

func (CoherentReadCloser) ReadersC64

func (cr CoherentReadCloser) ReadersC64() ([]sdr.Reader, error)

ReadersC64 will return a Reader slice, but converting to C64 while writing them out.

func (CoherentReadCloser) Sync

func (cr CoherentReadCloser) Sync(planner fft.Planner) ([]complex64, error)

Sync will check the algnment of the buffers. For best results the RNG needs to be on.

type CoherentSdr

type CoherentSdr struct {
	*Sdr
	// contains filtered or unexported fields
}

CoherentSdr will return a "meta-sdr" that tunes each of the 4 Kerberos SDR dongles to the same frequency, and allow for a StartCoherentRx call.

func NewCoherent

func NewCoherent(planner fft.Planner, i1, i2, i3, i4 uint, windowSize uint) (*CoherentSdr, error)

NewCoherent will create a new CoherentSdr.

func (*CoherentSdr) StartCoherentRx

func (c *CoherentSdr) StartCoherentRx() (sdr.ReadClosers, error)

StartCoherentRx will start all the RTL dongles, align the Readers, and return a slice of CoherentReadCloser objects.

This will toggle the BiasT feature (RNG), and also flip the AGC on. If the AGC is not needed, it needs to be explicitly turned off after this function call.

type OffsetSdr

type OffsetSdr struct {
	*CoherentSdr
	// contains filtered or unexported fields
}

OffsetSdr will return a "meta-sdr" that tunes each of the 4 Kerberos SDR dongles to adjacent frequency bands, and combine those SDRs into a single SDR at 4 times the sample rate.

func NewOffset

func NewOffset(planner fft.Planner, i1, i2, i3, i4 uint, windowSize uint) (*OffsetSdr, error)

NewOffset will create a new OffsetSdr.

func (*OffsetSdr) GetSampleRate

func (k *OffsetSdr) GetSampleRate() (uint, error)

GetSampleRate implements the sdr.Sdr interface.

func (*OffsetSdr) SetCenterFrequency

func (k *OffsetSdr) SetCenterFrequency(freq rf.Hz) error

SetCenterFrequency will set the 4 RTL tuners to adjacent frequency bands to allow for capture at a higher sample rate.

func (*OffsetSdr) SetSampleRate

func (k *OffsetSdr) SetSampleRate(sps uint) error

SetSampleRate implements the sdr.Sdr interface.

func (*OffsetSdr) StartRx

func (k *OffsetSdr) StartRx() (sdr.ReadCloser, error)

StartRx will start a coherent receive, align the buffers, and return a reader which will stream at 4 times the sample rate of the underlying SDR objects.

Mismatched sample rates, changing frequencies under the hood or changing things manually during the RX may result in some seriously weird shit.

type Sdr

type Sdr [4]*rtl.Sdr

Sdr is a Kerberos SDR, 4 RTL-SDR dongles in one!

func New

func New(i1, i2, i3, i4 uint, windowSize uint) (*Sdr, error)

New will create a new Kerberos SDR

func (Sdr) Close

func (k Sdr) Close() error

Close implements the sdr.Sdr interface.

func (Sdr) GetCenterFrequency

func (k Sdr) GetCenterFrequency() (rf.Hz, error)

GetCenterFrequency implements the sdr.Sdr interface.

func (Sdr) GetGain

func (k Sdr) GetGain(gainStage sdr.GainStage) (float32, error)

GetGain implements the sdr.Sdr interface.

func (Sdr) GetGainStages

func (k Sdr) GetGainStages() (sdr.GainStages, error)

GetGainStages implements the sdr.Sdr interface.

func (Sdr) GetPPM

func (k Sdr) GetPPM() int

GetPPM gets the PPM Offset.

func (Sdr) GetSampleRate

func (k Sdr) GetSampleRate() (uint, error)

GetSampleRate implements the sdr.Sdr interface.

func (Sdr) HardwareInfo

func (k Sdr) HardwareInfo() sdr.HardwareInfo

HardwareInfo implements the sdr.Sdr interface.

func (Sdr) ResetBuffer

func (k Sdr) ResetBuffer() error

ResetBuffer will reset the rtl-sdr Buffers.

func (Sdr) SampleFormat

func (k Sdr) SampleFormat() sdr.SampleFormat

SampleFormat implements the sdr.Sdr interface.

func (Sdr) SetAutomaticGain

func (k Sdr) SetAutomaticGain(automatic bool) error

SetAutomaticGain implements the sdr.Sdr interface.

func (Sdr) SetBiasT

func (k Sdr) SetBiasT(on bool) error

SetBiasT will toggle the GPIO Pin #1, which is the RNG source on the KSDR.

func (Sdr) SetBiasTGPIO

func (k Sdr) SetBiasTGPIO(pin int, on bool) error

SetBiasTGPIO will toggle a GPIO Pin.

func (Sdr) SetCenterFrequency

func (k Sdr) SetCenterFrequency(freq rf.Hz) error

SetCenterFrequency implements the sdr.Sdr interface.

func (Sdr) SetGain

func (k Sdr) SetGain(gainStage sdr.GainStage, gain float32) error

SetGain implements the sdr.Sdr interface.

func (Sdr) SetPPM

func (k Sdr) SetPPM(ppm int) error

SetPPM sets the PPM offset.

func (Sdr) SetSampleRate

func (k Sdr) SetSampleRate(sps uint) error

SetSampleRate implements the sdr.Sdr interface.

func (Sdr) SetTestMode

func (k Sdr) SetTestMode(on bool) error

SetTestMode will turn the RTL-SDR into a test mode.

func (Sdr) Tuner

func (k Sdr) Tuner() rtl.Tuner

Tuner will return the RTL-SDR Tuner object in the Kerberos SDR provided.

Directories

Path Synopsis
Package internal contains kerberos specific internal bits of API.
Package internal contains kerberos specific internal bits of API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL