Skip to content

Commit

Permalink
First sources commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
eriwave committed Oct 3, 2020
1 parent be928d1 commit c1f984b
Show file tree
Hide file tree
Showing 144 changed files with 32,803 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
__pycache__
*.pyc
*.py~
.eggs/
.ipynb_checkpoints/
.vscode/
*.egg-info/
build/
docs/_autosummary/
docs/_build/
dist/
tmp/
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
# scikit-sdr
Python 3 library that provides algorithms for building digital communication systems and for experimenting with DSP and SDR

**scikit-sdr** is a Python 3 library that provides algorithms for building digital communication systems and for experimenting with DSP and SDR.
The structure of the library is as follows:

- ``sksdr``: source code for algorithms
- ``tests``: units tests using the pytest framework
- ``demo``: demonstrations using Jupyter notebooks
- ``gnuradio``: GNU Radio wrappers contained in an OOT module (``gnuradio/gr-grsksdr``) and some demonstration flowgraphs (``gnuradio/demo``)
- ``docs``: Sphinx documentation

Some of this work as been inspired and/or based of other libraries such as [komm](https://github.com/rwnobrega/komm) and [scikit-dsp-comm](https://github.com/mwickert/scikit-dsp-comm). Other sources include the books:
- "Digital Communications: A Discrete-time Approach" by Michael Rice
- "Understanding Digital Signal Processing" by Richard G. Lyons
- "Digital Signal Processing: Principles, Algorithms and Applications" by John G. Proakis and Dimitris G. Manolakis

25 changes: 25 additions & 0 deletions build_frame_bits.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import numpy as np

import sksdr

msgs = ['Hello World {:03d}'.format(i) for i in range(100)]
rx_msg_idx = 0
ret = dict()
frame_size_bits = 250
preamble = np.repeat(sksdr.UNIPOLAR_BARKER_SEQ[13], 2)
scrambler_poly = [1, 1, 1, 0, 1]
scrambler_init_state = [0, 1, 1, 0]
scrambler = sksdr.Scrambler(scrambler_poly, scrambler_init_state)
fid = open('test.dat', 'wb')

for i, msg in enumerate(msgs):
ret['payload'] = sksdr.x2binlist(msg, 8)
ret['fill'] = np.random.randint(0, 1, frame_size_bits - len(preamble) - len(ret['payload']))
ret['bits'] = np.hstack((ret['payload'], ret['fill']))
ret['sbits'] = scrambler(ret['bits'])
bits = np.hstack((preamble, ret['sbits']))
nbits = len(bits)
if nbits % 8 > 0:
bits = np.hstack((bits, [0] * (8 - nbits % 8)))
chars = [int(''.join(map(str, bits[i : i + 8])), 2) for i in range(0, len(bits), 8)]
fid.write(bytes(chars))
Loading

0 comments on commit c1f984b

Please sign in to comment.