Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.0.21 #396

Merged
merged 51 commits into from
Jun 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
dcdef42
Reword "maximal" to "maximum"
mhostetter Jun 12, 2024
36852cb
Clean up m-sequence wording
mhostetter Jun 12, 2024
8a4fd83
Use `m` as the degree
mhostetter Jun 12, 2024
1b006e8
Add `sdr.plot.shannon_limit_ebn0()`
mhostetter Jun 12, 2024
1274920
Add `sdr.plot.correlation()`
mhostetter Jun 13, 2024
aac130c
Rework sequence correlation plots
mhostetter Jun 13, 2024
b9f393e
Add citation file
mhostetter Jun 13, 2024
7fcf603
Add citation to README
mhostetter Jun 13, 2024
fac1e15
Check for and handle None docstrings
Jun 13, 2024
507c802
Bump galois dependency version
Jun 13, 2024
66a2d9d
Add `sdr.preferred_pairs()`
mhostetter Jun 13, 2024
4970ae8
Add unit tests for `preferred_pairs()`
mhostetter Jun 13, 2024
6b47544
Add `sdr.is_preferred_pair()`
mhostetter Jun 13, 2024
34415db
Add unit tests for `is_preferred_pair()`
mhostetter Jun 13, 2024
414410e
Fix typo
mhostetter Jun 13, 2024
43608f7
Ignore nuisance warning
mhostetter Jun 13, 2024
1d0445c
Change language
mhostetter Jun 13, 2024
a3f0b9c
Add function references
mhostetter Jun 13, 2024
dfc6f5d
Add `sdr.gold_code()`
mhostetter Jun 13, 2024
4475319
Add unit tests for `gold_code()`
mhostetter Jun 13, 2024
f627486
Reword symbol-mapping code degrees
mhostetter Jun 13, 2024
072086f
Make variables more consistent
mhostetter Jun 13, 2024
7809a7d
Use consistent terminology
mhostetter Jun 14, 2024
bfbc148
Fix broken unit test
mhostetter Jun 14, 2024
8abc121
Update examples link
mhostetter Jun 14, 2024
b7bb0de
Color dark theme black
mhostetter Jun 15, 2024
cc27dd6
Fix SciPy intersphinx mapping
mhostetter Jun 15, 2024
f52a8ca
Fix matplotlib intersphinx mapping
mhostetter Jun 15, 2024
3a42034
Standardize capitalization in figures
mhostetter Jun 15, 2024
9de7297
Add `sdr.plot.stem()`
mhostetter Jun 15, 2024
f7355ab
Add selectable color to `sdr.plot.stem()`
mhostetter Jun 15, 2024
f4ec581
Move `stem()` to separate file
mhostetter Jun 15, 2024
481ead8
Add a standard helper plot
mhostetter Jun 15, 2024
4220c3c
Fix capitalization
mhostetter Jun 15, 2024
1f027e5
Document missing argument
mhostetter Jun 15, 2024
0b856fb
Add more plot helpers
mhostetter Jun 15, 2024
ac9e9c8
Add plot titles
mhostetter Jun 15, 2024
d08eec6
Add label to `stem()` plot
mhostetter Jun 15, 2024
9cd390e
Add `sdr.plot.fft`
mhostetter Jun 15, 2024
002f704
Rearrange arguments
mhostetter Jun 15, 2024
0b6dfee
Add stem plots to impulse/step responses
mhostetter Jun 15, 2024
bc7c438
Fix bug in call signature
mhostetter Jun 15, 2024
e2a681d
Fix bug/typo
mhostetter Jun 15, 2024
00d9bfe
Fix variable names
mhostetter Jun 15, 2024
ba9e1e0
Add `sdr.plot.dtft()`
mhostetter Jun 15, 2024
8353027
Add to dictionary
mhostetter Jun 15, 2024
002502e
Use new `dtft()` function
mhostetter Jun 15, 2024
0334401
Fix typo
mhostetter Jun 15, 2024
15a8a38
Update examples
mhostetter Jun 15, 2024
e462d13
Update feature list
mhostetter Jun 15, 2024
352a6e1
Add release notes for v0.0.21
mhostetter Jun 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"downsampled",
"downsamples",
"downsampling",
"DTFT",
"dtype",
"exponentials",
"exponentiating",
Expand Down Expand Up @@ -98,6 +99,7 @@
"newaxis",
"Nyquist",
"overdamped",
"oversample",
"oversampled",
"packbits",
"PAPR",
Expand Down
8 changes: 8 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Hostetter"
given-names: "Matt"
title: "sdr: A software-defined radio package for Python"
date-released: 2023-07-09
url: "https://github.com/mhostetter/sdr"
33 changes: 29 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ View all available classes and functions in the [API Reference](https://mhostett
infinite impulse response (IIR) filters, polyphase interpolators, polyphase decimators, polyphase resamplers,
polyphase channelizers, Farrow arbitrary resamplers, fractional delay FIR filters, FIR moving averagers,
FIR differentiators, IIR integrators, IIR leaky integrators, complex mixing, real/complex conversion.
- **Sequences**: Binary, Gray, Barker, Hadamard, Walsh, Kasami, Zadoff-Chu, m-sequences, Fibonacci LFSRs, Galois LFSRs,
LFSR synthesis.
- **Sequences**: Binary, Gray, Barker, Hadamard, Walsh, Gold, Kasami, Zadoff-Chu, $m$-sequences, preferred pairs,
Fibonacci LFSRs, Galois LFSRs, LFSR synthesis.
- **Coding**: Block interleavers, additive scramblers.
- **Modulation**: Phase-shift keying (PSK), $\pi/M$ PSK, offset QPSK, continuous-phase modulation (CPM),
minimum-shift keying (MSK), rectangular pulse shapes, half-sine pulse shapes, Gaussian pulse shapes,
Expand All @@ -72,12 +72,37 @@ View all available classes and functions in the [API Reference](https://mhostett
- **Link budgets**: BSC, BEC, AWGN, and BI-AWGN channel capacity, Shannon's limit on $E_b/N_0$ and $S/N$,
free-space path loss, antenna gain.
- **Miscellaneous**: Packing and unpacking binary data, hexdump of binary data.
- **Plotting**: Time-domain, raster, periodogram, spectrogram, constellation, symbol map, eye diagram, phase tree,
- **Plotting**: Time-domain, raster, correlation, stem, discrete Fourier transform (DFT), discrete-time Fourier
transform (DTFT), periodogram, spectrogram, constellation, symbol map, eye diagram, phase tree,
bit error rate (BER), symbol error rate (SER), probability of detection, receiver operating characteristic (ROC),
detection PDFs, impulse response, step response, zeros/poles, magnitude response, phase response,
phase delay, and group delay.

## Examples

There are detailed examples published at <https://mhostetter.github.io/sdr/latest/examples/pulse-shapes/>.
There are detailed examples published at <https://mhostetter.github.io/sdr/latest/examples/fir-filters/>.
The Jupyter notebooks behind the examples are available for experimentation in `docs/examples/`.

## Citation

If this library was useful to you in your research, please cite us. Following the
[GitHub citation standards](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files),
here is the recommended citation.

### BibTeX

```bibtex
@software{Hostetter_SDR_2023,
title = {{sdr: A software-defined radio package for Python}},
author = {Hostetter, Matt},
month = {7},
year = {2023},
url = {https://github.com/mhostetter/sdr},
}
```

### APA

```
Hostetter, M. (2023). sdr: A software-defined radio package for Python [Computer software]. https://github.com/mhostetter/sdr
```
22 changes: 11 additions & 11 deletions docs/_static/extra.css
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
/* Set the colors for the light theme */
[data-md-color-scheme="default"] {
/* [data-md-color-scheme="default"] {
--md-primary-fg-color: #344FA1;
--md-accent-fg-color: #4564C3;
}
} */

/* Set the colors for the dark theme */
[data-md-color-scheme="slate"] {
/* [data-md-color-scheme="slate"] {
--md-primary-fg-color: #EAA915;
--md-accent-fg-color: #EEBA44;
}
} */

[data-md-color-scheme="slate"] .md-header {
background-color: #344FA1;
/* [data-md-color-scheme="slate"] .md-header {
background-color: var(--md-primary-fg-color);
}

[data-md-color-scheme="slate"] .md-tabs {
background-color: #344FA1;
}
background-color: var(--md-primary-fg-color);
} */

/* @media screen and (max-width: 76.1875em) */
.md-nav--primary .md-nav__title[for=__drawer] {
/* .md-nav--primary .md-nav__title[for=__drawer] {
background-color: #344FA1;
}

.md-source {
background-color: #344FA1;
}
} */

/* Fix line numbers in code blocks */
.linenos {
Expand All @@ -35,7 +35,7 @@

/* Override md-tab-set colors. */
.md-typeset .tabbed-labels {
--md-accent-fg-color: var(--md-primary-fg-color);
--md-accent-fg-color: var(--md-typeset-a-color);
}

/* Modify Sphinx Immaterial python-apigen linkable parameter coloring. */
Expand Down
6 changes: 3 additions & 3 deletions docs/api/plotting.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Plotting
========

Configuration
-------------
Utility
-------

.. python-apigen-group:: plot-config
.. python-apigen-group:: plot-utility

Time-domain
-----------
Expand Down
8 changes: 6 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@
{
"media": "(prefers-color-scheme: light)",
"scheme": "default",
"primary": "indigo",
"accent": "indigo",
"toggle": {
"icon": "material/weather-night",
"name": "Switch to dark mode",
Expand All @@ -167,6 +169,8 @@
{
"media": "(prefers-color-scheme: dark)",
"scheme": "slate",
"primary": "black",
"accent": "indigo",
"toggle": {
"icon": "material/weather-sunny",
"name": "Switch to light mode",
Expand Down Expand Up @@ -199,8 +203,8 @@
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"scipy": ("http://docs.scipy.org/doc/scipy/reference/", None),
"matplotlib": ("http://matplotlib.sourceforge.net/", None),
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
"matplotlib": ("https://matplotlib.org/stable/", None),
"galois": ("https://mhostetter.github.io/galois/latest/", None),
}

Expand Down
10 changes: 5 additions & 5 deletions docs/examples/coherent-integration.ipynb

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions docs/examples/farrow-resampler.ipynb

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions docs/examples/fir-filters.ipynb

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions docs/examples/iir-filters.ipynb

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions docs/examples/non-coherent-integration.ipynb

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/examples/peak-to-average-power.ipynb

Large diffs are not rendered by default.

1,234 changes: 617 additions & 617 deletions docs/examples/phase-locked-loop.ipynb

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions docs/examples/psk.ipynb

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions docs/examples/pulse-shapes.ipynb

Large diffs are not rendered by default.

32 changes: 29 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ View all available classes and functions in the `API Reference <https://mhostett
infinite impulse response (IIR) filters, polyphase interpolators, polyphase decimators, polyphase resamplers,
polyphase channelizers, Farrow arbitrary resamplers, fractional delay FIR filters, FIR moving averagers,
FIR differentiators, IIR integrators, IIR leaky integrators, complex mixing, real/complex conversion.
- **Sequences**: Binary, Gray, Barker, Hadamard, Walsh, Kasami, Zadoff-Chu, m-sequences, Fibonacci LFSRs, Galois LFSRs,
LFSR synthesis.
- **Sequences**: Binary, Gray, Barker, Hadamard, Walsh, Gold, Kasami, Zadoff-Chu, $m$-sequences, preferred pairs,
Fibonacci LFSRs, Galois LFSRs, LFSR synthesis.
- **Coding**: Block interleavers, additive scramblers.
- **Modulation**: Phase-shift keying (PSK), $\pi/M$ PSK, offset QPSK, continuous-phase modulation (CPM),
minimum-shift keying (MSK), rectangular pulse shapes, half-sine pulse shapes, Gaussian pulse shapes,
Expand All @@ -79,11 +79,37 @@ View all available classes and functions in the `API Reference <https://mhostett
- **Link budgets**: BSC, BEC, AWGN, and BI-AWGN channel capacity, Shannon's limit on $E_b/N_0$ and $S/N$,
free-space path loss, antenna gain.
- **Miscellaneous**: Packing and unpacking binary data, hexdump of binary data.
- **Plotting**: Time-domain, raster, periodogram, spectrogram, constellation, symbol map, eye diagram, phase tree,
- **Plotting**: Time-domain, raster, correlation, stem, discrete Fourier transform (DFT), discrete-time Fourier
transform (DTFT), periodogram, spectrogram, constellation, symbol map, eye diagram, phase tree,
bit error rate (BER), symbol error rate (SER), probability of detection, receiver operating characteristic (ROC),
detection PDFs, impulse response, step response, zeros/poles, magnitude response, phase response,
phase delay, and group delay.

Citation
--------

If this library was useful to you in your research, please cite us. Following the `GitHub citation standards <https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files>`_, here is the recommended citation.

.. md-tab-set::

.. md-tab-item:: BibTeX

.. code-block:: latex

@software{Hostetter_SDR_2023,
title = {{sdr: A software-defined radio package for Python}},
author = {Hostetter, Matt},
month = {7},
year = {2023},
url = {https://github.com/mhostetter/sdr},
}

.. md-tab-item:: APA

.. code-block:: text

Hostetter, M. (2023). sdr: A software-defined radio package for Python [Computer software]. https://github.com/mhostetter/sdr

.. toctree::
:caption: Examples
:hidden:
Expand Down
23 changes: 23 additions & 0 deletions docs/release-notes/v0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,29 @@ tocdepth: 2

# v0.0

## v0.0.21

*Released June 15, 2024*

### Changes

- Added Gold codes in `sdr.gold_code()`.
- Added calculation of primitive polynomials that generate preferred pair $m$-sequences in `sdr.preferred_pairs()`.
- Added check if two primitive polynomials form a preferred pair in `sdr.is_preferred_pair()`.
- Added plot of the discrete Fourier transform (DFT) in `sdr.plot.dft()`.
- Added plot of the discrete-time Fourier transform (DTFT) in `sdr.plot.dtft()`.
- Added plot of periodic and non-periodic auto- and cross-correlations (PACF, ACF, PCCF, and CCF) in
`sdr.plot.correlation()`.
- Added general-purpose stem plot, styled like MATLAB, in `sdr.plot.stem()`.
- Added plot of Shannon's limit on $E_b/N_0$ in `sdr.plot.shannon_limit_ebn0()`.
- Added support for `python -OO` optimization.
- Increased required `galois` version to `v0.3.9`.

### Contributors

- Justin Charlong ([@jcharlong](https://github.com/jcharlong))
- Matt Hostetter ([@mhostetter](https://github.com/mhostetter))

## v0.0.20

*Released June 9, 2024*
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ dependencies = [
"numba", # Use galois's version limitation
"scipy",
"matplotlib",
"galois == 0.3.8", # Exact match required because of use of internals
"galois == 0.3.9", # Exact match required because of use of internals
"typing_extensions >= 4.0.0", # v4.0.0 is needed for use of Self (Python 3.11+) and Literal (Python 3.8+)
]
dynamic = ["version"]
Expand Down Expand Up @@ -119,7 +119,7 @@ extend-select = [

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401", "F403"]
"tests/*" = ["D"]
"tests/*" = ["D", "D415"]

[tool.ruff.lint.pydocstyle]
convention = "google"
Expand Down
4 changes: 2 additions & 2 deletions src/sdr/_detection/_approximation.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,8 @@ def shnidman(
ax[i].semilogx(p_fa, sdr.shnidman(p_d, p_fa, n_nc=n_nc, swerling=4), label=4)
ax[i].legend(title="Swerling")
ax[i].set_xlabel("Probability of false alarm, $P_{fa}$")
ax[i].set_ylabel("Minimum required input SNR (dB)")
ax[i].set_title(f"$N_{{nc}}={n_nc}$")
ax[i].set_ylabel("Minimum required input SNR (dB), $\gamma$")
ax[i].set_title(f"$N_{{nc}} = {n_nc}$")
@savefig sdr_shnidman_1.png
fig.suptitle("Minimum required SNR across Swerling target models");

Expand Down
2 changes: 2 additions & 0 deletions src/sdr/_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def extend_docstring(method, replace=None, docstring=""):

def decorator(obj):
parent_docstring = getattr(method, "__doc__", "")
if parent_docstring is None:
return obj
for from_str, to_str in replace.items():
parent_docstring = parent_docstring.replace(from_str, to_str)
obj.__doc__ = parent_docstring + "\n" + docstring
Expand Down
2 changes: 1 addition & 1 deletion src/sdr/_sequence/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

from ._correlation import *
from ._lfsr import *
from ._maximal import *
from ._maximum import *
from ._symbol_mapping import *
Loading
Loading