Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9f4404d
Small refactor, replace random bytes with GLFSR PN sequence in exampl…
mcdiarmid Oct 11, 2024
d2ab833
SOQPSK-MIL was looking wrong, correct the pulse filter and also updat…
mcdiarmid Oct 11, 2024
d52bbf2
Lint, leave information in docstring regarding a likely implementatio…
mcdiarmid Oct 11, 2024
877926b
Make polynomials more readable for GLFSR.
mcdiarmid Oct 15, 2024
469f211
Define Galois LFSRs up to n=64, of which ITU-T O.150 was a subset.
mcdiarmid Oct 15, 2024
3c617ff
Refactor viz to it's own submodule
mcdiarmid Oct 23, 2024
37ba23c
Reflect constellation support in readme, add phase-tree todo.
mcdiarmid Oct 23, 2024
78ea864
Add dev md doc, version lock dev tools.
mcdiarmid Oct 23, 2024
f43980b
Version locking of black broke 3.8 compat.
mcdiarmid Oct 23, 2024
26a2922
Adjust CI, add first unit test.
mcdiarmid Oct 23, 2024
13c9b05
Fix issue with setup python action.
mcdiarmid Oct 23, 2024
748df23
Drop 3.13 for now.
mcdiarmid Oct 23, 2024
8ac05f0
Copy-paste error in CI.
mcdiarmid Oct 23, 2024
aa47b00
Refactor, viz additions, working towards solving some fundamental pro…
mcdiarmid Nov 11, 2024
f385b6b
Lint
mcdiarmid Nov 11, 2024
3c3c98f
Flip-flopping on repo structure lmao.
mcdiarmid Nov 11, 2024
b89d764
WIP fixing alignment of things.
mcdiarmid Nov 12, 2024
aa7d4fa
Lint and visibly cleaner eye, phase tree, PSD, etc.
mcdiarmid Nov 13, 2024
8940563
SOQPSK PAM Decomp waveforms look right but need to look further into …
mcdiarmid Nov 13, 2024
3838e3a
Switch to UV, refactor waveforms-viz from package to extra.
mcdiarmid Apr 10, 2025
a12511e
Remove black, isort lint option, work on pam decomp.
mcdiarmid Apr 11, 2025
8906f8a
Best detection performance thus far, I think I've fixed PT?
mcdiarmid Apr 11, 2025
a6da3b7
Try fix CI
mcdiarmid Apr 11, 2025
c611ffd
Update outdated dev doc.
mcdiarmid Apr 12, 2025
db4db22
Add v1 phase tree, use phase_tree and constellation in soqpsk_example.py
mcdiarmid Apr 12, 2025
38a702f
Format layout and save fig after two new plots.
mcdiarmid Apr 12, 2025
de89aaf
Update pic.
mcdiarmid Apr 12, 2025
1b27ae9
Replace legacy mappers with trellis encoders, fix input cardinality c…
mcdiarmid Apr 12, 2025
3fad406
Lint
mcdiarmid Apr 13, 2025
e626be0
Remove empty py files, out of scope for current MR.
mcdiarmid Apr 13, 2025
9836a33
Standardize viz plotting function names with plot_ prefix.
mcdiarmid Apr 13, 2025
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
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI

on: [push]

jobs:
lint:
runs-on: ubuntu-latest
name: Linting py${{ matrix.python-version }}
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
pyproject-file: ./pyproject.toml

- name: Install
run: |
uv python install ${{ matrix.python-version }}
uv sync --group dev --extra viz

- name: Lint Python Code
run: |
uv run ruff check

- name: Format Check Python Code
run: |
uv run ruff format --check

test:
runs-on: ${{ matrix.os }}
name: Unit Testing py${{ matrix.python-version }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
pyproject-file: ./pyproject.toml

- name: Install
run: |
uv python install ${{ matrix.python-version }}
uv sync --group dev --extra viz

- name: test
run: |
uv run pytest
27 changes: 0 additions & 27 deletions .github/workflows/lint.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ __pycache__/
venv/
*.egg-info/
dist/
build/
.vscode/
15 changes: 15 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Developer notes

## Environment Setup

```bash
uv sync --group dev --extra viz
```

## Dev Checks

```bash
uv run ruff check
uv run ruff format --check
uv run pytest
```
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ The plan is to explore all of the following concepts in this repository:
- Common RF Plots
- Power Spectral Density (PSD) ✔️
- Eye Diagram ✔️
- Constellation
- Constellation ✔️
- Phase-tree
- Detection efficiency performance curve
- Digital Signal Processing Concepts
- S-domain
Expand Down
26 changes: 15 additions & 11 deletions examples/irig_comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,32 @@
from waveforms.cpm.multih import (
MULTIH_IRIG_DENOM,
MULTIH_IRIG_NUMER,
MultiHSymbolMapper,
freq_pulse_multih_irig,
)
from waveforms.cpm.pcmfm import (
PCMFM_DENOM,
PCMFM_NUMER,
PCMFMSymbolMapper,
freq_pulse_pcmfm,
)
from waveforms.cpm.soqpsk import (
SOQPSK_DENOM,
SOQPSK_NUMER,
SOQPSKPrecoder,
freq_pulse_soqpsk_tg,
)
from waveforms.cpm.trellis.encoder import TrellisEncoder
from waveforms.cpm.trellis.model import (
SimpleTrellis2,
SimpleTrellis4,
SOQPSKTrellis4x2DiffEncoded,
)
from waveforms.glfsr import PNSequence


rng = np.random.Generator(np.random.PCG64())

DATA_HEADER = b"\x1b\x1bHello World!"
DATA_EXTRA = bytes(rng.integers(0, 0xFF, size=4000, endpoint=True, dtype=np.uint8))
DATA_BUFFER = DATA_HEADER + DATA_EXTRA
j = complex(0, 1)
PN_DEGREE = 15
DATA_GEN = PNSequence(PN_DEGREE)
DATA_BUFFER = np.packbits(DATA_GEN.generate_sequence())


if __name__ == "__main__":
Expand All @@ -46,21 +50,21 @@
irig_waveforms = [
(
"PCM-FM",
PCMFMSymbolMapper(),
TrellisEncoder(SimpleTrellis2),
PCMFM_NUMER / PCMFM_DENOM,
freq_pulse_pcmfm(sps=sps, order=6),
1,
),
(
"SOQPSK-TG",
SOQPSKPrecoder(),
TrellisEncoder(SOQPSKTrellis4x2DiffEncoded),
SOQPSK_NUMER / SOQPSK_DENOM,
freq_pulse_soqpsk_tg(sps=sps),
1,
),
(
"Multi-h CPM",
MultiHSymbolMapper(),
TrellisEncoder(SimpleTrellis4),
MULTIH_IRIG_NUMER / MULTIH_IRIG_DENOM,
freq_pulse_multih_irig(sps=sps),
2,
Expand Down Expand Up @@ -152,4 +156,4 @@

fig_psd.tight_layout()
fig_psd.savefig(Path(__file__).parent.parent / "images" / "irig106_waveform_comparison.png")
fig_psd.show()
plt.show()
32 changes: 11 additions & 21 deletions examples/pcmfm_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,27 @@

from waveforms.cpm.helpers import normalize_cpm_filter
from waveforms.cpm.modulate import cpm_modulate
from waveforms.cpm.pcmfm import (
PCMFM_DENOM,
PCMFM_NUMER,
PCMFMSymbolMapper,
freq_pulse_pcmfm,
)
from waveforms.cpm.pcmfm import PCMFM_DENOM, PCMFM_NUMER
from waveforms.cpm.trellis.encoder import TrellisEncoder
from waveforms.cpm.trellis.model import SimpleTrellis2
from waveforms.glfsr import PNSequence


rng = np.random.Generator(np.random.PCG64())

DATA_HEADER = b"\x1b\x1bHello World!"
DATA_EXTRA = bytes(rng.integers(0, 0xFF, size=4000, endpoint=True, dtype=np.uint8))
DATA_BUFFER = DATA_HEADER + DATA_EXTRA
j = complex(0, 1)
PN_DEGREE = 15
DATA_GEN = PNSequence(PN_DEGREE)
DATA_BUFFER = np.packbits(DATA_GEN.generate_sequence())


if __name__ == "__main__":
sps = 20
fft_size = 2**10
length = 3
tau = np.linspace(0, length, num=length * sps)
bit_array = np.unpackbits(np.frombuffer(DATA_BUFFER, dtype=np.uint8))
bit_array = np.unpackbits(DATA_BUFFER)

irig_waveforms = [
(
"PCM-FM",
PCMFMSymbolMapper(),
PCMFM_NUMER / PCMFM_DENOM,
freq_pulse_pcmfm(sps=sps, order=4),
),
]
mapper = PCMFMSymbolMapper()
mapper = TrellisEncoder(SimpleTrellis2)
symbols = mapper(bit_array)
mod_index = PCMFM_NUMER / PCMFM_DENOM

Expand Down Expand Up @@ -114,4 +104,4 @@

fig.tight_layout()
fig.savefig(Path(__file__).parent.parent / "images" / "pcmfm_bessel_comparison.png")
fig.show()
plt.show()
Loading
Loading