rtlsdr_helper

Support functions for the RTL-SDR using pyrtlsdr

Copyright (c) July 2017, Mark Wickert All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project.

sk_dsp_comm.rtlsdr_helper.complex2wav(filename, rate, x)[source]

Save a complex signal vector to a wav file for compact binary storage of 16-bit signal samples. The wav left and right channels are used to save real (I) and imaginary (Q) values. The rate is just a convent way of documenting the original signal sample rate.

complex2wav(filename,rate,x)

Mark Wickert April 2014

sk_dsp_comm.rtlsdr_helper.discrim(x)[source]

function disdata = discrim(x) where x is an angle modulated signal in complex baseband form.

Mark Wickert

sk_dsp_comm.rtlsdr_helper.fsk_BEP(rx_data, m, flip)[source]

Estimate the BEP of the data bits recovered by the RTL-SDR Based FSK Receiver.

The reference m-sequence generated in Python was found to produce sequences running in the opposite direction relative to the m-sequences generated by the mbed. To allow error detection the reference m-sequence is flipped.

Mark Wickert April 2014

sk_dsp_comm.rtlsdr_helper.mono_FM(x, fs=2400000.0, file_name='test.wav')[source]

Decimate complex baseband input by 10 Design 1st decimation lowpass filter (f_c = 200 KHz)

sk_dsp_comm.rtlsdr_helper.pilot_PLL(xr, fq, fs, loop_type, Bn, zeta)[source]

Mark Wickert, April 2014

sk_dsp_comm.rtlsdr_helper.sccs_bit_sync(y, Ns)[source]
Symbol synchronization algorithm using SCCS
y = baseband NRZ data waveform

Ns = nominal number of samples per symbol

Reworked from ECE 5675 Project Translated from m-code version Mark Wickert April 2014

sk_dsp_comm.rtlsdr_helper.stereo_FM(x, fs=2400000.0, file_name='test.wav')[source]

Stereo demod from complex baseband at sampling rate fs. Assume fs is 2400 ksps

Mark Wickert July 2017

sk_dsp_comm.rtlsdr_helper.wav2complex(filename)[source]

Return a complex signal vector from a wav file that was used to store the real (I) and imaginary (Q) values of a complex signal ndarray. The rate is included as means of recalling the original signal sample rate.

fs,x = wav2complex(filename)

Mark Wickert April 2014