Documentation ¶
Index ¶
- Variables
- func Calibrate(s SDR) error
- func FindPPM(sdr SDR) (float64, error)
- type Bands
- type DongleInfo
- type FreqBand
- type HzBand
- type IQReader
- type IQWriter
- type MixerIQReader
- type RTLTCPSDR
- func (sdr *RTLTCPSDR) Connect(addr *net.TCPAddr) (err error)
- func (sdr *RTLTCPSDR) SetAGCMode(state bool) error
- func (sdr *RTLTCPSDR) SetCenterFreq(freq uint32) error
- func (sdr *RTLTCPSDR) SetDirectSampling(state uint32) error
- func (sdr *RTLTCPSDR) SetFreqCorrection(ppm uint32) error
- func (sdr *RTLTCPSDR) SetGain(gain uint32) error
- func (sdr *RTLTCPSDR) SetGainByIndex(idx uint32) error
- func (sdr *RTLTCPSDR) SetGainMode(state bool) error
- func (sdr *RTLTCPSDR) SetOffsetTuning(state bool) error
- func (sdr *RTLTCPSDR) SetRTLXtalFreq(freq uint32) error
- func (sdr *RTLTCPSDR) SetSampleRate(rate uint32) error
- func (sdr *RTLTCPSDR) SetTestMode(state bool) error
- func (sdr *RTLTCPSDR) SetTunerIfGain(stage, gain uint16) error
- func (sdr *RTLTCPSDR) SetTunerXtalFreq(freq uint32) error
- type SDR
- type SDRFormat
- type SDRHWInfo
- type ScanConfig
- type SpectralPower
- func (sp *SpectralPower) Average() []float64
- func (sp *SpectralPower) BandPower(fb FreqBand, samps int) float64
- func (sp *SpectralPower) Bands() (ret []FreqBand)
- func (sp *SpectralPower) Measure(ch <-chan []complex64) error
- func (sp *SpectralPower) NoiseFloor() float64
- func (sp *SpectralPower) Spread() float64
- func (sp *SpectralPower) Spurs() (ret []FreqBand)
- func (sp *SpectralPower) Stddev() float64
Constants ¶
This section is empty.
Variables ¶
var ErrBadSampleRate = errors.New("bad sample rate")
var ErrFrequencyOutOfRange = errors.New("frequency out of range")
var ErrRateOutOfRange = errors.New("sample rate out of range")
Functions ¶
Types ¶
type DongleInfo ¶
type DongleInfo struct { Magic [4]byte Tuner uint32 GainCount uint32 // Useful for setting gain by index }
DongleInfo is data pulled from the RTLTCPSDR on connection.
func (DongleInfo) Valid ¶
func (d DongleInfo) Valid() bool
Valid checks the received magic number matches the expected byte string 'RTL0'.
type FreqBand ¶
TODO: replace with HzBand
func NewFreqRange ¶
func Scan ¶
func Scan(sdr SDR, cfg ScanConfig) (ret []FreqBand)
func ScanIQReader ¶
func ScanIQReader(iqr *MixerIQReader, minWidthHz float64) (ret []FreqBand, err error)
func (FreqBand) BandwidthKHz ¶
type HzBand ¶
func HzBandRange ¶
type IQReader ¶
type IQReader struct {
// contains filtered or unexported fields
}
func NewIQReader ¶
NewIQReader takes a reader that uses u8 I/Q samples.
func (*IQReader) BatchStream64 ¶
func (*IQReader) ToMixer ¶
func (iqr *IQReader) ToMixer(hzb HzBand) *MixerIQReader
type IQWriter ¶
type IQWriter struct {
// contains filtered or unexported fields
}
func NewIQWriter ¶
type MixerIQReader ¶
func NewMixerIQReader ¶
func NewMixerIQReader(r io.Reader, hzb HzBand) *MixerIQReader
type RTLTCPSDR ¶
type RTLTCPSDR struct { *net.TCPConn Info DongleInfo }
RTLTCPSDR contains dongle information and an embedded tcp connection to the spectrum server.
func (*RTLTCPSDR) Connect ¶
Give an address of the form "127.0.0.1:1234" connects to the spectrum server at the given address or returns an error. The user is responsible for closing this connection. If addr is nil, use "127.0.0.1:1234" or command line flag value.
func (*RTLTCPSDR) SetAGCMode ¶
Set RTL AGC mode, true for enabled.
func (*RTLTCPSDR) SetCenterFreq ¶
Set the center frequency in Hz.
func (*RTLTCPSDR) SetDirectSampling ¶
Set direct sampling mode. 0 = disabled, 1 = i-branch, 2 = q-branch, 3 = direct mod.
func (*RTLTCPSDR) SetFreqCorrection ¶
Set frequency correction in ppm.
func (*RTLTCPSDR) SetGainByIndex ¶
Set gain by index, must be <= DongleInfo.GainCount
func (*RTLTCPSDR) SetGainMode ¶
Set the Tuner AGC, true to enable.
func (*RTLTCPSDR) SetOffsetTuning ¶
Set offset tuning, true for enabled.
func (*RTLTCPSDR) SetRTLXtalFreq ¶
Set RTL xtal frequency.
func (*RTLTCPSDR) SetSampleRate ¶
Set the sample rate in Hz.
func (*RTLTCPSDR) SetTestMode ¶
Set test mode, true for enabled.
func (*RTLTCPSDR) SetTunerIfGain ¶
Set tuner intermediate frequency stage and gain.
func (*RTLTCPSDR) SetTunerXtalFreq ¶
Set tuner xtal frequency.
type SDR ¶
type SDRFormat ¶
type SDRHWInfo ¶
type ScanConfig ¶
type SpectralPower ¶
type SpectralPower struct {
// contains filtered or unexported fields
}
func NewSpectralPower ¶
func NewSpectralPower(band FreqBand, bins, ffts int) *SpectralPower
func (*SpectralPower) Average ¶
func (sp *SpectralPower) Average() []float64
func (*SpectralPower) BandPower ¶
func (sp *SpectralPower) BandPower(fb FreqBand, samps int) float64
func (*SpectralPower) Bands ¶
func (sp *SpectralPower) Bands() (ret []FreqBand)
func (*SpectralPower) Measure ¶
func (sp *SpectralPower) Measure(ch <-chan []complex64) error
func (*SpectralPower) NoiseFloor ¶
func (sp *SpectralPower) NoiseFloor() float64
func (*SpectralPower) Spread ¶
func (sp *SpectralPower) Spread() float64
func (*SpectralPower) Spurs ¶
func (sp *SpectralPower) Spurs() (ret []FreqBand)
func (*SpectralPower) Stddev ¶
func (sp *SpectralPower) Stddev() float64