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.1 #7

Merged
merged 95 commits into from
Jul 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
be91484
Add Google Analytics
mhostetter Jul 7, 2023
705ba78
Remove invalid `"repo_type"` parameter
mhostetter Jul 7, 2023
0839ebd
Remove "hello, world" from package import
mhostetter Jul 7, 2023
fb19ea6
Add `scipy` dependency
mhostetter Jul 7, 2023
b6cb7d4
Add Farrow arbitrary resampler in `sdr.FarrowResampler`
mhostetter Jul 7, 2023
ea4ae30
Add Farrow resampler example
mhostetter Jul 7, 2023
e0d1711
Ignore `jupyter_execute/` in docs folder
mhostetter Jul 7, 2023
3667858
Add examples to Farrow resampler properties
mhostetter Jul 7, 2023
7ad54b1
Add Farrow resampler to API reference
mhostetter Jul 7, 2023
020b067
Update Farrow resampler example
mhostetter Jul 7, 2023
10daeb4
Add unit test for Farrow resampler
mhostetter Jul 7, 2023
4647258
Add `test` CI workflow
mhostetter Jul 7, 2023
39c9ba9
Add `matplotlib` dependency
mhostetter Jul 7, 2023
5f7ea03
Officially support Python 3.7 to 3.11
mhostetter Jul 7, 2023
9425d65
Add feature list
mhostetter Jul 8, 2023
e6ca1d0
Enable `$...$` math in rST
mhostetter Jul 8, 2023
d6f777d
Fix length of Farrow resampler output when not streaming
mhostetter Jul 8, 2023
9d8b19f
Update the example sections
mhostetter Jul 8, 2023
d0bd7c8
Fix bug in streaming Farrow resampler previous input array
mhostetter Jul 8, 2023
19435c4
Fix initial fractional sample delay in streaming mode
mhostetter Jul 8, 2023
0e893ae
Calculate fractional sample delays more accurately
mhostetter Jul 8, 2023
8d60d02
Add unit test for Farrow resampler in streaming mode
mhostetter Jul 8, 2023
4ab6442
Add links to `scipy` and `matplotlib` in documentation
mhostetter Jul 8, 2023
d7e2b0f
Add IIR filters in `sdr.IIR`
mhostetter Jul 8, 2023
d12eb2c
Add IIR filter example
mhostetter Jul 8, 2023
cb3b702
Add unit test for single-pole IIR filters
mhostetter Jul 8, 2023
2aa5be9
Add zeros, poles, and gain properties to IIR filter
mhostetter Jul 8, 2023
9ebbaa4
Add impulse response method
mhostetter Jul 8, 2023
8c2ee70
Add step response method
mhostetter Jul 8, 2023
b5e56c7
Add plot impulse response method
mhostetter Jul 8, 2023
b913201
Add plot step response method
mhostetter Jul 8, 2023
9099f3c
Compute zeros and poles only once
mhostetter Jul 8, 2023
bde642d
Fix step response nomenclature
mhostetter Jul 8, 2023
100141b
Add plot zeros and poles method
mhostetter Jul 8, 2023
054fc45
Add a plotting methods section in docs
mhostetter Jul 8, 2023
f13c610
Point documentation to the IIR filter example
mhostetter Jul 8, 2023
0f6e774
Add plot frequency response method
mhostetter Jul 8, 2023
43e56e5
Add `typing_extensions` dependency
mhostetter Jul 8, 2023
18cedbd
Fix bug in plotting zeros and poles
mhostetter Jul 8, 2023
676b835
Add classmethod to construct an IIR filter from its zeros and poles
mhostetter Jul 8, 2023
5efe50e
Add method to plot all relevant plots in one figure
mhostetter Jul 8, 2023
57ebf84
Place legends in a more appropriate place
mhostetter Jul 8, 2023
6ee779f
Make phase response dotted
mhostetter Jul 8, 2023
dd9100e
Format jupyter notebooks on save
mhostetter Jul 8, 2023
d963e76
Add method to plot group delay
mhostetter Jul 8, 2023
01267d0
Update IIR filter example
mhostetter Jul 8, 2023
a58992e
Add IIR filters to feature list
mhostetter Jul 8, 2023
03eb279
Fix linter errors
mhostetter Jul 8, 2023
6ca58fe
Fix docstring
mhostetter Jul 8, 2023
dc173eb
Clean up Farrow resampler docstrings
mhostetter Jul 8, 2023
a119fd4
Rename `_iir.py` to `_iir_filter.py`
mhostetter Jul 8, 2023
7be3185
Fix obscure VS Code pytest discovery issue
mhostetter Jul 9, 2023
6c51fdf
Use `$$...$$` math
mhostetter Jul 9, 2023
28001c7
Allow IIR taps to be float or complex
mhostetter Jul 9, 2023
a817aec
Plot power of frequency response
mhostetter Jul 9, 2023
f4eb907
Label frequency axes as "Normalized Frequency"
mhostetter Jul 9, 2023
bd07677
Add option to plot frequency response phase
mhostetter Jul 9, 2023
2d4684c
Add logarithmic frequency response plot
mhostetter Jul 9, 2023
8ab7d80
Fix bug in `plot_all()` parameters
mhostetter Jul 9, 2023
9a35d2e
Prevent impulse and step response methods from affecting filter state
mhostetter Jul 9, 2023
2528d07
Add a numerically-controlled oscillator in `sdr.NCO`
mhostetter Jul 9, 2023
b6da624
Add unit tests for NCO
mhostetter Jul 9, 2023
182da5b
Add a direct digital synthesizer in `sdr.DDS`
mhostetter Jul 9, 2023
714e198
Add unit tests for the DDS
mhostetter Jul 9, 2023
f84000f
Rename example
mhostetter Jul 9, 2023
560ea1d
Rename reference
mhostetter Jul 9, 2023
5596077
Add PLL section in API reference
mhostetter Jul 9, 2023
2522ef6
Add a 2nd order loop filter
mhostetter Jul 9, 2023
a0763d5
Add unit tests for the loop filter
mhostetter Jul 9, 2023
0c9201d
Add PLL example notebook
mhostetter Jul 9, 2023
a098b0d
Add more loop filter unit tests
mhostetter Jul 9, 2023
c3acd85
Add NCO, DDS, and loop filter to feature list
mhostetter Jul 9, 2023
05860ec
Support running `black` on Jupyter notebooks
mhostetter Jul 9, 2023
8b934be
Fix formatting
mhostetter Jul 9, 2023
283acdd
Add more detail to Farrow resampler example
mhostetter Jul 9, 2023
06afa9f
Add frequency response methods to IIR filters
mhostetter Jul 9, 2023
f56b8a2
Update PLL notebook
mhostetter Jul 9, 2023
1faae7c
Fix linter error
mhostetter Jul 9, 2023
b941658
Add performance analysis of closed-loop PLLs in `sdr.ClosedLoopPLL`
mhostetter Jul 9, 2023
a17ea91
Update PLL example
mhostetter Jul 9, 2023
3d54d9d
Add words to repo dictionary
mhostetter Jul 9, 2023
d26d915
Add links to the PLL example
mhostetter Jul 9, 2023
6d9479f
Add docstring to PLL analysis object
mhostetter Jul 9, 2023
371df5a
Fix typo in frequency response
mhostetter Jul 9, 2023
5f1931d
Clean up equation appearance
mhostetter Jul 9, 2023
095263b
Add missing example links
mhostetter Jul 9, 2023
58efd3f
Add `ClosedLoopPLL` to feature list
mhostetter Jul 9, 2023
943f984
Fix linter error
mhostetter Jul 9, 2023
e9dc839
Add `@export` decorator
mhostetter Jul 9, 2023
d10ba6b
Use `@export` decorator throughout library
mhostetter Jul 9, 2023
b8f7557
Resize figures
mhostetter Jul 9, 2023
8d9f037
Fix linter error
mhostetter Jul 9, 2023
a095849
Enable auto GitHub releases
mhostetter Jul 9, 2023
d46bad5
Add more detail to the `README`
mhostetter Jul 9, 2023
e56f28f
Add release notes for v0.0.1
mhostetter Jul 9, 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
64 changes: 32 additions & 32 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,42 +14,42 @@ jobs:
name: Build the docs
uses: ./.github/workflows/docs.yaml

# release:
# name: Create GitHub release
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# with:
# fetch-depth: 0 # Fetch all commits and tags
# ref: ${{ github.ref }}
release:
name: Create GitHub release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all commits and tags
ref: ${{ github.ref }}

# - name: Get current version
# id: current
# run: |
# version=$(git tag --sort=-version:refname | head -n 1)
# echo "version=${version}" >> $GITHUB_OUTPUT
- name: Get current version
id: current
run: |
version=$(git tag --sort=-version:refname | head -n 1)
echo "version=${version}" >> $GITHUB_OUTPUT

# - name: Get previous version
# id: previous
# run: |
# version=$(git tag --sort=-version:refname | head -n 2 | tail -1)
# echo "version=${version}" >> $GITHUB_OUTPUT
- name: Get previous version
id: previous
run: |
version=$(git tag --sort=-version:refname | head -n 2 | tail -1)
echo "version=${version}" >> $GITHUB_OUTPUT

# - name: Construct release notes
# run: |
# # cp docs/release-notes/${{ steps.current.outputs.version }}.md release_notes.md
# echo -e "\n## Commits\n" > release_notes.md
# git log --oneline ${{ steps.previous.outputs.version }}..${{ steps.current.outputs.version }} >> release_notes.md
- name: Construct release notes
run: |
# cp docs/release-notes/${{ steps.current.outputs.version }}.md release_notes.md
echo -e "\n## Commits\n" > release_notes.md
git log --oneline ${{ steps.previous.outputs.version }}..${{ steps.current.outputs.version }} >> release_notes.md

# - name: Create GitHub release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ steps.current.outputs.version }}
# release_name: galois ${{ steps.current.outputs.version }}
# body_path: release_notes.md
# draft: true
- name: Create GitHub release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.current.outputs.version }}
release_name: sdr ${{ steps.current.outputs.version }}
body_path: release_notes.md
draft: true

publish:
name: Publish on PyPI
Expand Down
178 changes: 178 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
name: Test

on:
push:
branches:
- main
- 'release/*'
pull_request:
branches:
- main
- 'release/*'

jobs:
wait-on-wheel:
name: Wait for wheel
runs-on: ubuntu-latest
steps:
- name: Wait on build.yaml to build the wheel
uses: lewagon/[email protected]
with:
# When triggered on a pull request, github.sha is a temporary merge commit for the PR. The wait
# action must wait on the SHA of the commit that triggered the workflow, which is the HEAD of the
# PR branch. https://github.com/lewagon/wait-on-check-action/issues/25#issuecomment-784773361
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
# NOTE: Fake ternary operator, see https://github.com/actions/runner/issues/409
repo-token: ${{ secrets.GITHUB_TOKEN }}
check-name: 'Wheel'
allowed-conclusions: success
wait-interval: 10

test-coverage:
name: Coverage
needs: wait-on-wheel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Upgrade pip
run: python3 -m pip install --upgrade pip

- name: Download wheel artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: build.yaml
workflow_conclusion: success
commit: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
# NOTE: Fake ternary operator, see https://github.com/actions/runner/issues/409

# This is needed because Windows terminal cannot expand `pip install sdr-*.whl`
- name: Get wheel file name
uses: tj-actions/glob@v15
id: glob
with:
files: sdr-*.whl
working-directory: dist/

- name: Install the dev dependencies
run: python3 -m pip install -r requirements-dev.txt

- name: Install the `sdr` package wheel with upgraded dependencies
run: python3 -m pip install --upgrade dist/${{ steps.glob.outputs.paths }}

- name: Test with pytest
run: python3 -m pytest -n auto --cov=sdr --cov-report=xml tests/

- name: Upload coverage report
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false
verbose: true

# test-min:
# name: Min
# needs: wait-on-wheel
# if: ${{ github.event_name == 'pull_request' }}
# strategy:
# matrix:
# os: [ubuntu-latest, macos-latest, windows-latest]
# python-version: [3.7, 3.8, 3.9, '3.10', 3.11]
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/checkout@v3

# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}

# - name: Upgrade pip
# run: python3 -m pip install --upgrade pip

# - name: Download wheel artifact
# uses: dawidd6/action-download-artifact@v2
# with:
# workflow: build.yaml
# workflow_conclusion: success
# commit: ${{github.event.pull_request.head.sha}}

# # This is needed because Windows terminal cannot expand `pip install sdr-*.whl`
# - name: Get wheel file name
# uses: tj-actions/glob@v15
# id: glob
# with:
# files: sdr-*.whl
# working-directory: dist/

# - name: Install the dev dependencies
# run: python3 -m pip install -r requirements-dev.txt

# - name: Install minimum package dependencies
# run: python3 -m pip install -r requirements-min.txt

# - name: Install the `sdr` package wheel with minimum dependencies
# run: python3 -m pip install dist/${{ steps.glob.outputs.paths }}

# - name: Test with pytest
# run: python3 -m pytest -n auto tests/

# - name: Upload coverage report
# uses: codecov/codecov-action@v3
# with:
# fail_ci_if_error: false
# verbose: true

test-latest:
name: Latest
needs: wait-on-wheel
if: ${{ github.event_name == 'pull_request' }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, 3.8, 3.9, '3.10', 3.11]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Upgrade pip
run: python3 -m pip install --upgrade pip

- name: Download wheel artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: build.yaml
workflow_conclusion: success
commit: ${{github.event.pull_request.head.sha}}

# This is needed because Windows terminal cannot expand `pip install sdr-*.whl`
- name: Get wheel file name
uses: tj-actions/glob@v15
id: glob
with:
files: sdr-*.whl
working-directory: dist/

- name: Install the dev dependencies
run: python3 -m pip install -r requirements-dev.txt

- name: Install the `sdr` package wheel with upgraded dependencies
run: python3 -m pip install --upgrade dist/${{ steps.glob.outputs.paths }}

- name: Test with pytest
run: python3 -m pytest -n auto tests/

- name: Upload coverage report
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false
verbose: true
12 changes: 11 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"python.testing.pytestArgs": [
"-c=pyproject.toml",
"tests/"
],
"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.codeActionsOnSave": {
"source.organizeImports": true
Expand All @@ -17,5 +17,15 @@
},
"editor.rulers": [
120
],
"cSpell.words": [
"Baseband",
"downsampling",
"Feedforward",
"overdamped",
"resampler",
"resamplers",
"underdamped",
"upsampling"
]
}
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,35 @@
</div>

A Python package for software-defined radio.

> Enjoying the library? Give us a :star: on [GitHub](https://github.com/mhostetter/sdr)!

## Features

- Filters:
- Infinite impulse response filter (`sdr.IIR`)
- Arbitrary resamplers:
- Farrow resampler (`sdr.FarrowResampler`)
- Signal generators:
- Numerically-controlled oscillator (`sdr.NCO`)
- Direct digital synthesizer (`sdr.DDS`)
- Phase-locked loops:
- Loop filter (`sdr.LoopFilter`)
- Closed-loop PLL analysis (`sdr.ClosedLoopPLL`)

## Documentation

The documentation for `sdr` is located at https://mhostetter.github.io/sdr/latest/.

## Install the package

The latest version of `sdr` can be installed from [PyPI](https://pypi.org/project/sdr/) using `pip`.

```console
$ python3 -m pip install sdr
```

## Examples

There are detailed examples published at https://mhostetter.github.io/sdr/latest/examples/iir-filter/.
The Jupyter notebooks behind the examples are available for experimentation in `docs/examples/`.
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
api/
build/
jupyter_execute/
15 changes: 15 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,18 @@

sdr
===

Filtering
---------

.. python-apigen-group:: filtering

Resampling
----------

.. python-apigen-group:: resampling

Phase/time-locked loops
-----------------------

.. python-apigen-group:: pll
Loading