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

Fix examples using old modulate() method #153

Merged
merged 2 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sphinx < 7.3
sphinx-immaterial == 0.11.8
sphinx-immaterial == 0.11.9
# For some reason, if the below versions aren't specified, the dependency resolution takes 18 minutes in CI.
myst-parser == 0.18.1
sphinx-design == 0.5.0
Expand Down
2 changes: 1 addition & 1 deletion src/sdr/_measurement/_modulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def evm(

psk = sdr.PSK(4, phase_offset=45); \
s = np.random.randint(0, psk.order, 1000); \
x = psk.modulate(s); \
x = psk.map_symbols(s); \
x_hat = sdr.awgn(x, 20)

@savefig sdr_evm_1.png
Expand Down
8 changes: 4 additions & 4 deletions src/sdr/_simulation/_impairment.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def awgn(

psk = sdr.PSK(4, phase_offset=45); \
s = np.random.randint(0, psk.order, 1_000); \
x = psk.modulate(s); \
x = psk.map_symbols(s); \
y = sdr.awgn(x, snr=10)

@savefig sdr_awgn_2.png
Expand Down Expand Up @@ -133,7 +133,7 @@ def iq_imbalance(x: npt.NDArray, amplitude: float, phase: float = 0) -> npt.NDAr

psk = sdr.PSK(4, phase_offset=45); \
s = np.random.randint(0, 4, 1_000); \
x = psk.modulate(s); \
x = psk.map_symbols(s); \
y1 = sdr.iq_imbalance(x, 5, 0); \
y2 = sdr.iq_imbalance(x, -5, 0)

Expand Down Expand Up @@ -207,7 +207,7 @@ def sample_rate_offset(x: npt.NDArray, ppm: float) -> npt.NDArray:

psk = sdr.PSK(4, phase_offset=45); \
s = np.random.randint(0, psk.order, 1_000); \
x = psk.modulate(s)
x = psk.map_symbols(s)

Add 10 ppm of sample rate offset.

Expand Down Expand Up @@ -283,7 +283,7 @@ def frequency_offset(

psk = sdr.PSK(4, phase_offset=45); \
s = np.random.randint(0, psk.order, 1_000); \
x = psk.modulate(s)
x = psk.map_symbols(s)

Add a frequency offset of 1 cycle per 10,000 symbols.

Expand Down