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.9 #142

Merged
merged 61 commits into from
Nov 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
35f5c14
Reword argument definition
mhostetter Oct 14, 2023
76a62bc
Add `db` kwarg to `energy()`
mhostetter Oct 14, 2023
246ad2c
Add `axis` kwarg to measurement functions
mhostetter Oct 14, 2023
c7ed3d5
Fix return type docstring
mhostetter Oct 14, 2023
492311f
Update VS Code settings for newer versions
mhostetter Oct 14, 2023
a783cff
Replace `pylint` with `ruff`
mhostetter Oct 25, 2023
572dac2
Use `ruff` linting in CI
mhostetter Oct 25, 2023
c4d37e7
Remove `pylint` config
mhostetter Oct 25, 2023
5889975
All more rule sets to `ruff`
mhostetter Oct 25, 2023
a294e40
View inline format issues on GitHub
mhostetter Oct 25, 2023
1550bb8
Remove `black` in favor of `ruff`
mhostetter Oct 25, 2023
d3f98dc
Ignore `E501` per Ruff's warning
mhostetter Oct 25, 2023
bfd14bf
Update CI to use `ruff format`
mhostetter Oct 25, 2023
e8ee1ad
Lint Jupyter notebooks with Ruff
mhostetter Oct 25, 2023
6f1d4c5
Fix lint errors in tests
mhostetter Oct 25, 2023
7f1a838
Indicate to `ruff` where first-party source code lives
mhostetter Oct 25, 2023
117b457
Lint unit tests in CI
mhostetter Oct 25, 2023
322d3d2
Add `pre-commit`
mhostetter Oct 27, 2023
b8ec7b3
Pin Ruff to v0.1.4
mhostetter Nov 4, 2023
65152a6
Update formatting
mhostetter Nov 4, 2023
db92c66
Document Ruff linting, formatting, and pre-commit
mhostetter Nov 4, 2023
11d39c4
Add `seed` to channel models
mhostetter Nov 4, 2023
9663267
Add `env/` to `.gitignore`
mhostetter Nov 4, 2023
11284ff
Upgrade `sphinx` and `sphinx-immaterial`
mhostetter Nov 5, 2023
9b85592
Add additional type aliases
mhostetter Nov 5, 2023
36c4f5a
Make doc dependencies have explicit versions
mhostetter Nov 5, 2023
b2beff9
Add words to dictionary
mhostetter Nov 10, 2023
52c992d
Fix typo
mhostetter Nov 10, 2023
73cfcce
Add `sdr.percent()` #128
mhostetter Nov 10, 2023
33ce132
Add `sdr.ppm()` #127
mhostetter Nov 10, 2023
fcaa4ef
Add `sdr.ppb()` #129
mhostetter Nov 10, 2023
1f8f613
Use `npt.NDArray` type annotations
mhostetter Nov 10, 2023
932b8ba
Add to dictionary
mhostetter Nov 10, 2023
8864a42
Suppress Sphinx warning
mhostetter Nov 10, 2023
073e35c
Add `__init__.py` to `pytest` folders
mhostetter Nov 10, 2023
b6ee4e1
Remove `DDS`
mhostetter Nov 11, 2023
a2216a3
Add settable properties notes in docs
mhostetter Nov 12, 2023
bf65158
Ensure phase of NCO first sample is the phase offset
mhostetter Nov 12, 2023
834f0ac
Add examples to NCO docs
mhostetter Nov 12, 2023
7847179
Add unit tests for `NCO` #133
mhostetter Nov 12, 2023
54fbe70
Slight reword to features
mhostetter Nov 12, 2023
ab20af5
Make polyphase filters with `"linear"` interpolation better match MATLAB
mhostetter Nov 12, 2023
73ac27a
Make a `"linear"` and `"linear-matlab"` polyphase interpolation method
mhostetter Nov 12, 2023
bc4f18d
Make private interpolation and decimation functions
mhostetter Nov 12, 2023
71f8959
Improve polyphase example plots
mhostetter Nov 12, 2023
712c2dd
Add `Resampler` polyphase rational resampler
mhostetter Nov 12, 2023
84b5675
Add unit tests for `Resampler`
mhostetter Nov 12, 2023
5f35b1e
Rename Matlab to MATLAB
mhostetter Nov 12, 2023
1d9a554
Make argument names more explicit
mhostetter Nov 12, 2023
d705f05
Better document polyphase FIR delay
mhostetter Nov 12, 2023
e5739f7
Rename resampling section
mhostetter Nov 12, 2023
7d73a80
Add `Differentiator`
mhostetter Nov 12, 2023
99aa333
Add unit tests for `Differentiator`
mhostetter Nov 12, 2023
f6525be
Simply class docstring titles
mhostetter Nov 12, 2023
a139d4a
Clean up `Differentiator` docstring
mhostetter Nov 12, 2023
62fb254
Add `Integrator`
mhostetter Nov 12, 2023
22a595d
Add unit tests for `Integrator`
mhostetter Nov 12, 2023
7d6df74
Add magnitude response to docstring
mhostetter Nov 12, 2023
bdf5fc3
Move sync tools to `_synchronization/` subpackage
mhostetter Nov 12, 2023
dcb1d5b
Update feature list
mhostetter Nov 12, 2023
404c144
Add release notes for v0.0.9
mhostetter Nov 12, 2023
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
15 changes: 6 additions & 9 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

jobs:
run-linter:
name: Lint
name: Ruff Lint
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -34,14 +34,11 @@ jobs:
- name: Install the `sdr` package
run: python3 -m pip install .

- name: Lint code with pylint
run: python3 -m pylint src/sdr/

# - name: Lint tests with pylint
# run: python3 -m pylint tests/
- name: Lint with ruff
run: python3 -m ruff check --output-format=github .

run-formatter:
name: Format
name: Ruff Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -60,5 +57,5 @@ jobs:
- name: Install the `sdr` package
run: python3 -m pip install .

- name: Format with black
run: python3 -m black . --check
- name: Format with ruff
run: python3 -m ruff format --check .
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ __pycache__/
# .pytest_cache/
# build/
dist/
# env/
env/
src/*.egg-info
src/sdr/_version.py
# .coverage
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-added-large-files
- id: check-yaml
- id: check-toml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.4
hooks:
- id: ruff
- id: ruff-format
52 changes: 44 additions & 8 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,57 +1,93 @@
{
"python.testing.pytestEnabled": true,
"python.testing.pytestArgs": [
"-c=pyproject.toml",
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"python.formatting.provider": "none",
"editor.formatOnSave": true,
"notebook.formatOnSave.enabled": true,
"[python]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"editor.defaultFormatter": "ms-python.black-formatter"
},
"editor.formatOnSave": true,
"editor.rulers": [
120
],
"cSpell.words": [
"Albersheim",
"Alouini",
"arange",
"arcsin",
"astype",
"atleast",
"awgn",
"baseband",
"beamwidth",
"BPSK",
"colorbar",
"correlator",
"cumsum",
"downsample",
"downsampled",
"downsamples",
"downsampling",
"dtype",
"exponentials",
"feedforward",
"figsize",
"frombuffer",
"fspl",
"hexdump",
"infty",
"intersymbol",
"iscomplexobj",
"isrealobj",
"issubdtype",
"linestyle",
"linewidth",
"lowpass",
"mathbb",
"matplotlib",
"memoryless",
"multirate",
"nanmax",
"ndarray",
"ndim",
"newaxis",
"Nyquist",
"overdamped",
"packbits",
"PAPR",
"passband",
"periodogram",
"periodograms",
"polyphase",
"Proakis",
"pyplot",
"QPSK",
"resampler",
"resamplers",
"savefig",
"scipy",
"semilogy",
"sidelobes",
"sinc",
"stopband",
"unaliased",
"uncoded",
"underdamped",
"unpackbits",
"upsampled",
"upsamples",
"upsampling"
"upsampling",
"xlabel",
"xlim",
"ylabel",
"ylim",
"Zadoff",
"zorder"
]
}
}
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ in Python. The library relies on and is designed to be interoperable with NumPy,
Performance is also very important. So, where possible, Numba is used to accelerate computationally-intensive
functions.

Additionally, the library aims to replicate relevant functionality from Matlab's Communications and
Additionally, the library aims to replicate relevant functionality from MATLAB's Communications and
DSP Toolboxes.

We are progressively adding functionality to the library. If there is something you'd like to see included
Expand All @@ -50,19 +50,18 @@ View all available classes and functions in the [API Reference](https://mhostett

- **Digital signal processing**: Finite impulse response (FIR) filters, infinite impulse response (IIR) filters,
polyphase interpolator, polyphase decimator, polyphase resampler, Farrow arbitrary resampler,
complex mixing, real/complex conversion.
FIR differentiator, IIR integrator, complex mixing, real/complex conversion.
- **Sequences**: Barker, Zadoff-Chu.
- **Modulation**: Phase-shift keying (PSK), $\pi/M$ PSK, offset QPSK, rectangular pulse shape, half-sine pulse shape,
raised cosine pulse shape, root raised cosine pulse shape, Gaussian pulse shape, binary and Gray symbol mapping,
differential encoding.
- **Synchronization**: Numerically-controlled oscillators (NCO), direct digital synthesizers (DDS), loop filters,
closed-loop PLL analysis.
- **Synchronization**: Numerically-controlled oscillators (NCO), loop filters, closed-loop PLL analysis.
- **Measurement**: Energy, power, voltage, bit/symbol error rate, error vector magnitude (EVM).
- **Conversions**: Between linear units and decibels. Between $E_b/N_0$, $E_s/N_0$, and $S/N$.
- **Simulation**: Binary symmetric channel (BSC), binary erasure channel (BEC), discrete memoryless channel (DMC),
additive white Gaussian noise (AWGN), frequency offset, sample rate offset, IQ imbalance.
- **Link budgets**: Channel capacities, free-space path loss, antenna gains.
- **Data manipulation**: Packing and unpacking binary data, hexdumping binary data.
- **Data manipulation**: Packing and unpacking binary data, hexdump of binary data.
- **Plotting**: Time-domain, raster, periodogram, spectrogram, constellation, symbol map, eye diagram,
bit error rate (BER), symbol error rate (SER), impulse response, step response, magnitude response, phase response,
phase delay, group delay, and zeros/poles.
Expand Down
2 changes: 1 addition & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
api/sdr.*
build/
jupyter_execute/
savefig/
savefig/
2 changes: 1 addition & 1 deletion docs/_templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
<a href="{{ '../' ~ base_url}}">
<strong>Click here to go to latest.</strong>
</a>
{% endblock %}
{% endblock %}
5 changes: 5 additions & 0 deletions docs/api/conversions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ Decibels

.. python-apigen-group:: conversions-decibels

Ratios
------

.. python-apigen-group:: conversions-ratios

From $E_b/N_0$
--------------

Expand Down
11 changes: 8 additions & 3 deletions docs/api/dsp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ Multirate filtering

.. python-apigen-group:: dsp-multirate-filtering

Resampling
----------
Arbitrary resampling
--------------------

.. python-apigen-group:: resampling
.. python-apigen-group:: dsp-arbitrary-resampling

Filtering applications
----------------------

.. python-apigen-group:: dsp-filtering-applications

Correlation
-----------
Expand Down
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
nitpick_ignore = [
("py:class", "numpy.typing.ArrayLike"), # Wish this would work
("py:class", "numpy.typing.DTypeLike"), # Wish this would work
("py:class", "numpy.typing.NDArray"), # Wish this would work
]


Expand Down Expand Up @@ -215,6 +216,7 @@
autodoc_type_aliases = {
"npt.ArrayLike": "~numpy.typing.ArrayLike",
"npt.DTypeLike": "~numpy.typing.DTypeLike",
"npt.NDArray": "~numpy.typing.NDArray",
}

ipython_execlines = [
Expand Down
77 changes: 77 additions & 0 deletions docs/development/formatting.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
Formatting
==========

The :obj:`sdr` library uses `Ruff <https://docs.astral.sh/ruff/>`_ for static analysis, linting, and code
formatting.

Install
-------

First, `ruff` needs to be installed on your system. Easily install it by installing the development dependencies.

.. code-block:: console

$ python3 -m pip install -r requirements-dev.txt

Configuration
-------------

The `ruff` configuration is provided in `pyproject.toml`.

.. literalinclude:: ../../pyproject.toml
:caption: pyproject.toml
:start-at: [tool.ruff]
:end-before: [tool.pytest.ini_options]
:language: toml

Run the linter
--------------

Run the Ruff linter manually from the command line.

.. code-block:: console

$ python3 -m ruff check .

Run the formatter
-----------------

Run the Ruff formatter manually from the command line.

.. code-block:: console

$ python3 -m ruff format --check .

Pre-commit
----------

A `pre-commit` configuration file with various hooks is provided in `.pre-commit-config.yaml`.

.. literalinclude:: ../../.pre-commit-config.yaml
:caption: .pre-commit-config.yaml
:language: yaml

Enable `pre-commit` by installing the pre-commit hooks.

.. code-block:: console

$ pre-commit install

Run `pre-commit` on all files.

.. code-block:: console

$ pre-commit run --all-files

Disable `pre-commit` by uninstalling the pre-commit hooks.

.. code-block:: console

$ pre-commit uninstall

Run from VS Code
----------------

Install the `Ruff extension <https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff>`_ for VS Code.
Included is a VS Code configuration file `.vscode/settings.json`.
VS Code will run the linter and formatter as you view and edit files.
41 changes: 0 additions & 41 deletions docs/development/linter.rst

This file was deleted.

Loading