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

More plots #395

Merged
merged 24 commits into from
Jun 15, 2024
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: 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
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.

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/plot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

from ._detection import *
from ._filter import *
from ._freq_domain import *
from ._modulation import *
from ._rc_params import *
from ._spectral_estimation import *
from ._time_domain import *
from ._utility import *
8 changes: 4 additions & 4 deletions src/sdr/plot/_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
def p_d(
x: npt.ArrayLike,
p_d: npt.ArrayLike,
x_label: Literal["snr", "enr"] = "snr",
ax: plt.Axes | None = None,
x_label: Literal["snr", "enr"] = "snr",
**kwargs,
):
r"""
Expand All @@ -28,8 +28,8 @@ def p_d(
Arguments:
x: The SNR or ENR in dB.
p_d: The probability of detection $P_d$.
x_label: The x-axis label to use.
ax: The axis to plot on. If `None`, the current axis is used.
x_label: The x-axis label to use.
kwargs: Additional keyword arguments to pass to :func:`matplotlib.pyplot.plot()`.

Group:
Expand Down Expand Up @@ -62,8 +62,8 @@ def p_d(
def roc(
p_fa: npt.ArrayLike,
p_d: npt.ArrayLike,
type: Literal["linear", "semilogx", "semilogy", "loglog"] = "semilogx",
ax: plt.Axes | None = None,
type: Literal["linear", "semilogx", "semilogy", "loglog"] = "semilogx",
**kwargs,
):
r"""
Expand All @@ -72,8 +72,8 @@ def roc(
Arguments:
p_fa: The probability of false alarm $P_{fa}$.
p_d: The probability of detection $P_d$.
type: The type of plot to generate.
ax: The axis to plot on. If `None`, the current axis is used.
type: The type of plot to generate.
kwargs: Additional keyword arguments to pass to the plotting function defined by `type`.

Group:
Expand Down
Loading
Loading