diff --git a/src/sdr/_data.py b/src/sdr/_data.py index 2b59fd2e9..bf0de44a9 100644 --- a/src/sdr/_data.py +++ b/src/sdr/_data.py @@ -129,7 +129,7 @@ def hexdump( Arguments: data: The data to display. Each element is considered one byte. Use :func:`sdr.pack()` - or :func:`sdr.unpack()` to convert data with variable bits per element. + or :func:`sdr.unpack` to convert data with variable bits per element. width: The number of bytes per line. Returns: diff --git a/src/sdr/_filter/_applications.py b/src/sdr/_filter/_applications.py index a3db24cfa..2e8a70282 100644 --- a/src/sdr/_filter/_applications.py +++ b/src/sdr/_filter/_applications.py @@ -184,7 +184,7 @@ def __init__( window: The SciPy window definition. See :func:`scipy.signal.windows.get_window` for details. If `None`, no window is applied. streaming: Indicates whether to use streaming mode. In streaming mode, previous inputs are - preserved between calls to :meth:`~sdr.Differentiator.__call__()`. + preserved between calls to :meth:`~sdr.Differentiator.__call__`. Examples: See the :ref:`fir-filters` example. diff --git a/src/sdr/_filter/_polyphase.py b/src/sdr/_filter/_polyphase.py index 1cd5078c9..9bb0871cc 100644 --- a/src/sdr/_filter/_polyphase.py +++ b/src/sdr/_filter/_polyphase.py @@ -640,7 +640,7 @@ def __init__( interpolation: The interpolation rate $P$. taps: The prototype filter design specification. - - `"kaiser"`: The prototype filter is designed using :func:`~sdr.multirate_fir()` + - `"kaiser"`: The prototype filter is designed using :func:`sdr.multirate_fir` with arguments `interpolation` and 1. - `"linear"`: The prototype filter is designed to linearly interpolate between samples. The filter coefficients are a length-$2P$ linear ramp $\frac{1}{P} [0, ..., P-1, P, P-1, ..., 1]$. @@ -818,7 +818,7 @@ def __init__( decimation: The decimation rate $Q$. taps: The prototype filter design specification. - - `"kaiser"`: The prototype filter is designed using :func:`~sdr.multirate_fir()` + - `"kaiser"`: The prototype filter is designed using :func:`sdr.multirate_fir` with arguments 1 and `decimation`. - `npt.ArrayLike`: The prototype filter feedforward coefficients $h[n]$. @@ -1004,7 +1004,7 @@ def __init__( decimation: The decimation rate $Q$. taps: The prototype filter design specification. - - `"kaiser"`: The prototype filter is designed using :func:`~sdr.multirate_fir()` + - `"kaiser"`: The prototype filter is designed using :func:`sdr.multirate_fir` with arguments `interpolation` and `decimation`. - `"linear"`: The prototype filter is designed to linearly interpolate between samples. The filter coefficients are a length-$2P$ linear ramp $\frac{1}{P} [0, ..., P-1, P, P-1, ..., 1]$. @@ -1210,7 +1210,7 @@ def __init__( channels: The number of channels $C$. taps: The prototype filter design specification. - - `"kaiser"`: The prototype filter is designed using :func:`~sdr.multirate_fir()` + - `"kaiser"`: The prototype filter is designed using :func:`sdr.multirate_fir` with arguments 1 and `rate`. - `npt.ArrayLike`: The prototype filter feedforward coefficients $h[n]$. diff --git a/src/sdr/_link_budget/_path_loss.py b/src/sdr/_link_budget/_path_loss.py index 9fa7b518f..7b7f19a87 100644 --- a/src/sdr/_link_budget/_path_loss.py +++ b/src/sdr/_link_budget/_path_loss.py @@ -75,7 +75,7 @@ def free_space_path_loss( (think dipole) is a function of frequency as well. So, as the frequency increases, the physical size of the isotropic antenna decreases. But what if the size of the antenna was fixed across frequency, as is the case with a parabolic dish antenna? You'll note that the gain of a parabolic dish antenna is also proportional to - the square of the frequency, see :func:`parabolic_antenna()`. + the square of the frequency, see :func:`sdr.parabolic_antenna`. It turns out that if omnidirectional antennas are used at both the transmitter and receiver, the total path loss increases with frequency. But if a parabolic reflector is used at one end, the total path loss is diff --git a/src/sdr/_sequence/_correlation.py b/src/sdr/_sequence/_correlation.py index bef9c3d0b..fabff417b 100644 --- a/src/sdr/_sequence/_correlation.py +++ b/src/sdr/_sequence/_correlation.py @@ -368,11 +368,11 @@ def gold_code( length: The length $n = 2^m - 1$ of the Gold code/sequence. index: The index $i$ in $[-2, n)$ of the Gold code. poly1: The primitive polynomial of degree $m$ over $\mathrm{GF}(2)$ for the first $m$-sequence. If `None`, - a preferred pair is found using :func:`sdr.preferred_pairs()`. + a preferred pair is found using :func:`sdr.preferred_pairs`. poly2: The primitive polynomial of degree $m$ over $\mathrm{GF}(2)$ for the second $m$-sequence. If `None`, - a preferred pair is found using :func:`sdr.preferred_pairs()`. + a preferred pair is found using :func:`sdr.preferred_pairs`. verify: Indicates whether to verify that the provided polynomials are a preferred pair using - :func:`sdr.is_preferred_pair()`. + :func:`sdr.is_preferred_pair`. output: The output format of the Gold code/sequence. - `"binary"` (default): The Gold code with binary values of 0 and 1. diff --git a/src/sdr/_simulation/_channel_model.py b/src/sdr/_simulation/_channel_model.py index 3a3957a19..e4baea509 100644 --- a/src/sdr/_simulation/_channel_model.py +++ b/src/sdr/_simulation/_channel_model.py @@ -23,7 +23,7 @@ def bsc( Arguments: x: The input sequence $x$ with $x_i \in \{0, 1\}$. p: The probability $p$ of a bit flip. - seed: The seed for the random number generator. This is passed to :func:`numpy.random.default_rng()`. + seed: The seed for the random number generator. This is passed to :func:`numpy.random.default_rng`. Returns: The output sequence $y$ with $y_i \in \{0, 1\}$. @@ -63,7 +63,7 @@ def bec( Arguments: x: The input sequence $x$ with $x_i \in \{0, 1\}$. p: The probability $p$ of a bit erasure. - seed: The seed for the random number generator. This is passed to :func:`numpy.random.default_rng()`. + seed: The seed for the random number generator. This is passed to :func:`numpy.random.default_rng`. Returns: The output sequence $y$ with $y_i \in \{0, 1, e\}$. Erasures $e$ are represented by -1. @@ -109,7 +109,7 @@ def dmc( $\mathcal{X} = \{0, 1, \ldots, m-1\}$. Y: The output alphabet $\mathcal{Y}$ of size $n$. If `None`, it is assumed that $\mathcal{Y} = \{0, 1, \ldots, n-1\}$. - seed: The seed for the random number generator. This is passed to :func:`numpy.random.default_rng()`. + seed: The seed for the random number generator. This is passed to :func:`numpy.random.default_rng`. Returns: The output sequence $y$ with $y_i \in \mathcal{Y}$. @@ -176,7 +176,7 @@ def __init__(self, seed: int | None = None): Creates a new channel. Arguments: - seed: The seed for the random number generator. This is passed to :func:`numpy.random.default_rng()`. + seed: The seed for the random number generator. This is passed to :func:`numpy.random.default_rng`. """ self._rng: np.random.Generator # Will be set in self.reset() @@ -187,7 +187,7 @@ def reset(self, seed: int | None = None): Resets the channel with a new seed. Arguments: - seed: The seed for the random number generator. This is passed to :func:`numpy.random.default_rng()`. + seed: The seed for the random number generator. This is passed to :func:`numpy.random.default_rng`. """ self._rng = np.random.default_rng(seed) @@ -287,7 +287,7 @@ def __init__(self, p: float, seed: int | None = None): Arguments: p: The transition probability $p$ of the BSC channel. - seed: The seed for the random number generator. This is passed to :func:`numpy.random.default_rng()`. + seed: The seed for the random number generator. This is passed to :func:`numpy.random.default_rng`. """ self._p = verify_scalar(p, float=True, inclusive_min=0, inclusive_max=1) @@ -418,7 +418,7 @@ def __init__(self, p: float, seed: int | None = None): Arguments: p: The erasure probability $p$ of the BEC channel. - seed: The seed for the random number generator. This is passed to :func:`numpy.random.default_rng()`. + seed: The seed for the random number generator. This is passed to :func:`numpy.random.default_rng`. """ self._p = verify_scalar(p, float=True, inclusive_min=0, inclusive_max=1) @@ -548,7 +548,7 @@ def __init__( P: The $m \times n$ transition probability matrix $P$, where $P = \Pr(Y = y_j | X = x_i)$. X: The input alphabet $\mathcal{X}$ of size $m$. If `None`, it is assumed that $\mathcal{X} = \{0, 1, \ldots, m-1\}$. Y: The output alphabet $\mathcal{Y}$ of size $n$. If `None`, it is assumed that $\mathcal{Y} = \{0, 1, \ldots, n-1\}$. - seed: The seed for the random number generator. This is passed to :func:`numpy.random.default_rng()`. + seed: The seed for the random number generator. This is passed to :func:`numpy.random.default_rng`. """ P = verify_arraylike(P, float=True, ndim=2, inclusive_min=0, inclusive_max=1) verify_condition(np.allclose(P.sum(axis=1), 1)) diff --git a/src/sdr/_simulation/_impairment.py b/src/sdr/_simulation/_impairment.py index afc37ba04..90279871d 100644 --- a/src/sdr/_simulation/_impairment.py +++ b/src/sdr/_simulation/_impairment.py @@ -30,7 +30,7 @@ def awgn( desired noise variance can be computed and passed in `noise`. If `snr` is `None`, `noise` must be specified. noise: The noise power (variance) in linear units. If `noise` is `None`, `snr` must be specified. - seed: The seed for the random number generator. This is passed to :func:`numpy.random.default_rng()`. + seed: The seed for the random number generator. This is passed to :func:`numpy.random.default_rng`. Returns: The noisy signal $x[n] + w[n]$. diff --git a/src/sdr/plot/_detection.py b/src/sdr/plot/_detection.py index 03beeba61..01ccfd303 100644 --- a/src/sdr/plot/_detection.py +++ b/src/sdr/plot/_detection.py @@ -30,7 +30,7 @@ def p_d( p_d: The probability of detection $P_d$. 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()`. + kwargs: Additional keyword arguments to pass to :func:`matplotlib.pyplot.plot`. Group: plot-detection @@ -139,7 +139,7 @@ def detector_pdfs( p_h0: The probability of the $\mathcal{H}_0$ tails to plot. The smaller the value, the longer the x-axis. p_h1: The probability of the $\mathcal{H}_1$ tails to plot. The smaller the value, the longer the x-axis. ax: The axis to plot on. If `None`, the current axis is used. - kwargs: Additional keyword arguments to pass to :func:`matplotlib.pyplot.plot()`. + kwargs: Additional keyword arguments to pass to :func:`matplotlib.pyplot.plot`. See Also: sdr.h0, sdr.h1, sdr.threshold diff --git a/src/sdr/plot/_filter.py b/src/sdr/plot/_filter.py index be1988d4b..cf347cfe8 100644 --- a/src/sdr/plot/_filter.py +++ b/src/sdr/plot/_filter.py @@ -225,7 +225,7 @@ def zeros_poles( feedback coefficients $a_j$. ax: The axis to plot on. If `None`, the current axis is used. - kwargs: Additional keyword arguments to pass to :func:`matplotlib.pyplot.plot()`. + kwargs: Additional keyword arguments to pass to :func:`matplotlib.pyplot.plot`. Examples: See the :ref:`fir-filters` example. @@ -312,7 +312,7 @@ def magnitude_response( for real-valued filters and `"two-sided"` for complex-valued filters. y_axis: The y-axis scaling. Options are to display a linear or logarithmic magnitude response. decades: The number of decades to plot when `x_axis="log"`. - kwargs: Additional keyword arguments to pass to :func:`matplotlib.pyplot.plot()`. + kwargs: Additional keyword arguments to pass to :func:`matplotlib.pyplot.plot`. Examples: See the :ref:`fir-filters` example. @@ -440,7 +440,7 @@ def phase_response( one-sided spectrum with a logarithmic frequency axis. The default is `"auto"` which selects `"one-sided"` for real-valued filters and `"two-sided"` for complex-valued filters. decades: The number of decades to plot when `x_axis="log"`. - kwargs: Additional keyword arguments to pass to :func:`matplotlib.pyplot.plot()`. + kwargs: Additional keyword arguments to pass to :func:`matplotlib.pyplot.plot`. Examples: See the :ref:`fir-filters` example. @@ -563,7 +563,7 @@ def phase_delay( one-sided spectrum with a logarithmic frequency axis. The default is `"auto"` which selects `"one-sided"` for real-valued filters and `"two-sided"` for complex-valued filters. decades: The number of decades to plot when `x_axis="log"`. - kwargs: Additional keyword arguments to pass to :func:`matplotlib.pyplot.plot()`. + kwargs: Additional keyword arguments to pass to :func:`matplotlib.pyplot.plot`. Examples: See the :ref:`fir-filters` example. @@ -687,7 +687,7 @@ def group_delay( one-sided spectrum with a logarithmic frequency axis. The default is `"auto"` which selects `"one-sided"` for real-valued filters and `"two-sided"` for complex-valued filters. decades: The number of decades to plot when `x_axis="log"`. - kwargs: Additional keyword arguments to pass to :func:`matplotlib.pyplot.plot()`. + kwargs: Additional keyword arguments to pass to :func:`matplotlib.pyplot.plot`. Examples: See the :ref:`fir-filters` example. diff --git a/src/sdr/plot/_modulation.py b/src/sdr/plot/_modulation.py index 144b15b14..b401c6c90 100644 --- a/src/sdr/plot/_modulation.py +++ b/src/sdr/plot/_modulation.py @@ -39,13 +39,13 @@ def constellation( ax: The axis to plot on. If `None`, the current axis is used. kwargs: Additional keyword arguments to pass to Matplotlib functions. - If `persistence=False`, the following keyword arguments are passed to :func:`matplotlib.pyplot.scatter()`. + If `persistence=False`, the following keyword arguments are passed to :func:`matplotlib.pyplot.scatter`. The defaults may be overwritten. - `"marker"`: `"."` - `"linestyle"`: `"none"` - If `persistence=True`, the following keyword arguments are passed to :func:`numpy.histogram2d()` and + If `persistence=True`, the following keyword arguments are passed to :func:`numpy.histogram2d` and :func:`matplotlib.pyplot.pcolormesh`. The defaults may be overwritten. - `"range"`: +/- 10% of the maximum value @@ -153,7 +153,7 @@ def symbol_map( limits: The axis limits, which apply to both the x- and y-axis. If `None`, the axis limits are set to 50% larger than the maximum value. ax: The axis to plot on. If `None`, the current axis is used. - kwargs: Additional keyword arguments to pass to :func:`matplotlib.pyplot.plot()`. + kwargs: Additional keyword arguments to pass to :func:`matplotlib.pyplot.plot`. The following keyword arguments are set by default. The defaults may be overwritten. - `"marker"`: `"x"` @@ -271,7 +271,7 @@ def eye( colorbar: Indicates whether to add a colorbar to the plot. This is only added if `color="index"` or `persistence=True`. ax: The axis to plot on. If `None`, the current axis is used. - kwargs: Additional keyword arguments to pass to :func:`sdr.plot.raster()`. + kwargs: Additional keyword arguments to pass to :func:`sdr.plot.raster`. Example: Modulate 1,000 QPSK symbols using a square root raised cosine (SRRC) pulse shaping filter. The SRRC pulse shape @@ -385,7 +385,7 @@ def phase_tree( color: Indicates how to color the rasters. If `"index"`, the rasters are colored based on their index. If a valid Matplotlib color, the rasters are all colored with that color. ax: The axis to plot on. If `None`, the current axis is used. - kwargs: Additional keyword arguments to pass to :func:`sdr.plot.raster()`. + kwargs: Additional keyword arguments to pass to :func:`sdr.plot.raster`. Example: Modulate 100 MSK symbols. @@ -465,7 +465,7 @@ def ber( ebn0: The bit energy $E_b$ to noise PSD $N_0$ ratio (dB). ber: The bit error rate $P_{be}$. ax: The axis to plot on. If `None`, the current axis is used. - kwargs: Additional keyword arguments to pass to :func:`matplotlib.pyplot.semilogy()`. + kwargs: Additional keyword arguments to pass to :func:`matplotlib.pyplot.semilogy`. Examples: Plot theoretical BER curves for BPSK, QPSK, 8-PSK, and 16-PSK in an AWGN channel. @@ -523,7 +523,7 @@ def ser( esn0: The symbol energy $E_s$ to noise PSD $N_0$ ratio (dB). ser: The symbol error rate $P_{se}$. ax: The axis to plot on. If `None`, the current axis is used. - kwargs: Additional keyword arguments to pass to :func:`matplotlib.pyplot.semilogy()`. + kwargs: Additional keyword arguments to pass to :func:`matplotlib.pyplot.semilogy`. Examples: Plot theoretical SER curves for BPSK, QPSK, 8-PSK, and 16-PSK in an AWGN channel. diff --git a/src/sdr/plot/_rc_params.py b/src/sdr/plot/_rc_params.py index 6d9530227..3446e0629 100644 --- a/src/sdr/plot/_rc_params.py +++ b/src/sdr/plot/_rc_params.py @@ -31,7 +31,7 @@ def use_style(): """ Applies :obj:`sdr`'s default :obj:`matplotlib` rcParams. - These style settings may be reverted with :func:`matplotlib.pyplot.rcdefaults()`. + These style settings may be reverted with :func:`matplotlib.pyplot.rcdefaults`. Examples: The following rcParams are applied. diff --git a/src/sdr/plot/_spectral_estimation.py b/src/sdr/plot/_spectral_estimation.py index 49d116050..9e7edac1f 100644 --- a/src/sdr/plot/_spectral_estimation.py +++ b/src/sdr/plot/_spectral_estimation.py @@ -55,7 +55,7 @@ def periodogram( one-sided spectrum with a logarithmic frequency axis. The default is `"auto"` which selects `"one-sided"` for real-valued signals and `"two-sided"` for complex-valued signals. y_axis: The y-axis scaling. Options are to display a linear or logarithmic power spectral density. - kwargs: Additional keyword arguments to pass to :func:`matplotlib.pyplot.plot()`. + kwargs: Additional keyword arguments to pass to :func:`matplotlib.pyplot.plot`. Group: plot-spectral-estimation @@ -144,7 +144,7 @@ def spectrogram( Plots the spectrogram of a time-domain signal $x[n]$ using Welch's method. Note: - This function uses :func:`scipy.signal.spectrogram()` to estimate the spectrogram of the time-domain signal. + This function uses :func:`scipy.signal.spectrogram` to estimate the spectrogram of the time-domain signal. Arguments: x: The time-domain signal $x[n]$. @@ -160,7 +160,7 @@ def spectrogram( y_axis: The y-axis scaling. Options are to display a one-sided spectrum or a two-sided spectrum. The default is `"auto"` which selects `"one-sided"` for real-valued signals and `"two-sided"` for complex-valued signals. - kwargs: Additional keyword arguments to pass to :func:`matplotlib.pyplot.pcolormesh()`. + kwargs: Additional keyword arguments to pass to :func:`matplotlib.pyplot.pcolormesh`. The following keyword arguments are set by default. The defaults may be overwritten. - `"vmin"`: 10th percentile diff --git a/src/sdr/plot/_time_domain.py b/src/sdr/plot/_time_domain.py index ad1c04dbb..47a0ebcc6 100644 --- a/src/sdr/plot/_time_domain.py +++ b/src/sdr/plot/_time_domain.py @@ -83,7 +83,7 @@ def time_domain( # noqa: D417 real and imaginary parts will have different colors based on the current Matplotlib color cycle. If `"line"`, the real part will have a solid line and the imaginary part will have a dashed line, and both lines will share the same color. - kwargs: Additional keyword arguments to pass to :func:`matplotlib.pyplot.plot()`. + kwargs: Additional keyword arguments to pass to :func:`matplotlib.pyplot.plot`. Examples: Plot a square-root raised cosine (SRRC) pulse shape centered about 0. @@ -332,7 +332,7 @@ def correlation( y: The second time-domain signal $y[n]$. sample_rate: The sample rate $f_s$ of the signal in samples/s. If `None`, the x-axis will be labeled as "Lag (samples)". - mode: The :func:`numpy.correlate()` correlation mode. If `"circular"`, a circular correlation is computed + mode: The :func:`numpy.correlate` correlation mode. If `"circular"`, a circular correlation is computed using FFTs. ax: The axis to plot on. If `None`, the current axis is used. y_axis: Indicates how to plot the y-axis. If `"complex"`, the real and imaginary parts are plotted separately. @@ -340,7 +340,7 @@ def correlation( real and imaginary parts will have different colors based on the current Matplotlib color cycle. If `"line"`, the real part will have a solid line and the imaginary part will have a dashed line, and both lines will share the same color. - kwargs: Additional keyword arguments to pass to :func:`matplotlib.pyplot.plot()`. + kwargs: Additional keyword arguments to pass to :func:`matplotlib.pyplot.plot`. Examples: Plot the auto-correlation of a length-63 $m$-sequence. Notice that the linear correlation produces sidelobes