Resource Allocation (Detailed Documentation)

This page provides the complete documentation of the resource allocation techniques for a SU-MIMO system.

waterfilling_v1(gamma, pt)[source]

Waterfilling algorithm for optimal power allocation across eigenchannels.

This function implements the waterfilling algorithm to find the optimal power allocation across N transmission channels (eigenchannels in a single-user MIMO system, given the channel-to-noise ratio (CNR) coefficients gamma and the total available transmit power pt.

In particular, it solves the following constraint optimization problem:

\[\begin{split}\begin{aligned} & \underset{\{p_n\}}{\text{max}} & & \sum_{n=1}^{N} \log_2 \left( 1 + \gamma_n \, p_n \right) \\ & \text{s. t.} & & \sum_{n=1}^{N} p_n = p_t \\ & & & \forall n \in \{1, \ldots, N\} : \, p_n \geq 0 \end{aligned}\end{split}\]
Parameters:
  • gamma (ndarray, shape (N,), dtype=float) – Channel-to-Noise Ratio (CNR) coefficients for each eigenchannel.

  • pt (float) – Total available transmit power.

Returns:

p – Optimal power allocation across the eigenchannels.

Return type:

ndarray, shape (N,), dtype=float

equal_power_allocation(Ns, pt)[source]

Equal power allocation across the eigenchannels of a SU-MIMO system.

Each eigenchannel is allocated an equal share of the total available transmit power, regardless of the channel conditions. This strategy is simple to implement and does not require any channel state information (CSI) at the transmitter.

Parameters:
  • Ns (int) – Number of eigenchannels (or spatial streams) to allocate power to.

  • pt (float) – Total available transmit power.

Returns:

p – Equal power allocation across the eigenchannels.

Return type:

ndarray, shape (Ns,), dtype=float

eigenbeamforming(Ns, pt)[source]

Eigenbeamforming power allocation across the eigenchannels of a SU-MIMO system.

All of the available transmit power is allocated to the strongest eigenchannel, while the remaining eigenchannels are allocated zero power.

Parameters:
  • Ns (int) – Number of eigenchannels (or spatial streams) to allocate power to.

  • pt (float) – Total available transmit power.

Returns:

p – Power allocation across the eigenchannels based on the eigenbeamforming method.

Return type:

ndarray, shape (Ns,), dtype=float

plot_waterfilling(Nt, Nr, snr_dB, p_signal=None, p_noise=None, num_samples=10000000.0)[source]

Generate a static waterfilling plot for a SU-MIMO system.

This function visualizes the optimal power allocation across the eigenchannels of a single-user MIMO system at a given SNR. The eigenchannel gains are taken as the expected values of the squared singular values of a random Gaussian zero-mean unit-variance channel matrix.

The eigenchannels are shown horizontally (on the x-axis), and ordered by their expected gain. The inverse channel-to-noise ratio (ICNR), the allocated power per eigenchannel, and the water level are shown vertically (on the y-axis).

Parameters:
  • Nt (int) – Number of transmit antennas.

  • Nr (int) – Number of receive antennas.

  • snr_dB (float) – Signal-to-Noise Ratio in decibels.

  • p_signal (float, optional) – Total transmit power. If provided, the noise power is scaled according to snr_dB.

  • p_noise (float, optional) – Total noise power. If provided, the transmit power is scaled according to snr_dB.

  • num_samples (int, optional) – Number of Monte Carlo samples used to compute the mean eigenchannel gains (default: 1e7).

Returns:

  • fig (matplotlib.figure.Figure) – The figure object containing the water-filling plot.

  • ax (matplotlib.axes.Axes) – The axes object of the figure.

demo_waterfilling(Nt, Nr, snr_dB_list, p_signal=None, p_noise=None, num_samples=10000000.0)[source]

Generate a waterfilling video plot for a SU-MIMO system across multiple SNR values.

This function visualizes how the optimal power allocation across the eigenchannels changes with increasing SNR. The eigenchannel gains are taken as the expected values of the squared singular values of a random Gaussian zero-mean unit-variance channel matrix.

The eigenchannels are shown horizontally (on the x-axis), and ordered by their expected gain. The inverse channel-to-noise ratio (ICNR), the allocated power per eigenchannel, and the water level are shown vertically (on the y-axis).

Parameters:
  • Nt (int) – Number of transmit antennas.

  • Nr (int) – Number of receive antennas.

  • snr_dB_list (ndarray, shape (N_snr_frames,), dtype=float) – Sequence of SNR values (in dB) to visualize.

  • p_signal (float, optional) – Total transmit power. If provided, noise power is adjusted according to snr_dB.

  • p_noise (float, optional) – Total noise power. If provided, transmit power is adjusted according to snr_dB.

  • num_samples (int, optional) – Number of Monte Carlo samples used to compute the mean eigenchannel gains (default: 1e7).

Returns:

animation – The animation object containing the water-filling video plot.

Return type:

matplotlib.animation.FuncAnimation

Raises:
  • FileNotFoundError – If the eigenchannel gains statistics file cannot be found.

  • ValueError – If neither or both of p_signal and p_noise are provided. Exactly one must be specified to compute the other using the SNR values.

adaptive_bit_allocation(gamma, p, B=0.5, R=1.0, c_type='QAM')[source]

Adaptive bit allocation for a SU-MIMO system based on the capacity of each eigenchannel.

Each eigenchannel is allocated a constellation size (in bits), i.e. the number of bits per symbol, equal to a fraction of the capacity of the eigenchannel.

Parameters:
  • gamma (ndarray, shape (Ns,), dtype=float) – Channel-to-Noise Ratio (CNR) coefficients for each eigenchannel.

  • p (ndarray, shape (Ns,), dtype=float) – Power allocation vector for each eigenchannel.

  • B (float, optional) – The available bandwidth in Hz. Default is 0.5 Hz.

  • R (float, optional) – The data rate. Represents the fraction of the eigenchannel capacity used for information transmission. Must be in the range (0, 1). Default is 1.0 (i.e., using the full capacity).

  • c_type (str, optional) – The constellation type. Must be either ‘PAM’, ‘PSK’, or ‘QAM’. Default is ‘QAM’.

Returns:

  • c (ndarray, shape (Ns,), dtype=float) – The capacity of each eigenchannel.

  • ibr (ndarray, shape (Ns,), dtype=int) – The information bit rate (IBR) for each eigenchannel.

plot_adaptive_bit_allocation(Nt, Nr, snr_dB, p_signal=1.0, pa_strategy='optimal', B=0.5, R=1.0, c_type='QAM', num_samples=10000000.0)[source]

Generate a static plot for the capacity and information bit rate of the eigenchannels of a SU-MIMO system.

This function visualizes the capacity and information bit rate of the eigenchannels of a single-user MIMO system for a given SNR value. The power allocation across the eigenchannels can be determined using different strategies, such as optimal waterfilling, equal power allocation, or eigenbeamforming. The eigenchannel gains are taken as the expected values of the squared singular values of a random Gaussian zero-mean unit-variance channel matrix.

The eigenchannels are shown horizontally (on the x-axis), and ordered by their expected gain. The capacity and information bit rate for each eigenchannel are shown as vertical bars, with the capacity bars colored in red and the information bit rate bars colored in orange.

Parameters:
  • Nt (int) – Number of transmit antennas.

  • Nr (int) – Number of receive antennas.

  • snr_dB (float) – Signal-to-noise ratio (SNR) in decibels (dB).

  • p_signal (float, optional) – The total available transmit power. Default is 1.0.

  • pa_strategy (str, optional) – The power allocation strategy to use. Must be one of the following: ‘optimal’, ‘equal’, ‘eigenbeamforming’. Default is ‘optimal’.

  • B (float, optional) – The available bandwidth in Hz. Default is 0.5 Hz.

  • R (float, optional) – The data rate. Represents the fraction of the eigenchannel capacity used for information transmission. Must be in the range [0, 1]. Default is 1.0 (i.e., using the full capacity).

  • c_type (str, optional) – The constellation type. Must be either ‘PAM’, ‘PSK’, or ‘QAM’. Default is ‘QAM’.

  • num_samples (int, optional) – The number of channel realizations used to compute the expected eigenchannel gains. Default is 10 million (1e7).

Returns:

  • fig (matplotlib.figure.Figure) – The figure object containing the plot.

  • ax (matplotlib.axes.Axes) – The axes object containing the plot.

demo_adaptive_bit_allocation(Nt, Nr, snr_dB_list, p_signal=1.0, pa_strategy='optimal', B=0.5, R=1.0, c_type='QAM', num_samples=10000000.0)[source]

Generate an animation for the capacity and information bit rate of the eigenchannels of a SU-MIMO system.

This function visualizes the capacity and information bit rate of the eigenchannels of a single-user MIMO system for a range of SNR values. The power allocation across the eigenchannels can be determined using different strategies, such as optimal waterfilling, equal power allocation, or eigenbeamforming. The eigenchannel gains are taken as the expected values of the squared singular values of a random Gaussian zero-mean unit-variance channel matrix.

The eigenchannels are shown horizontally (on the x-axis), and ordered by their expected gain. The capacity and information bit rate for each eigenchannel are shown as vertical bars, with the capacity bars colored in red and the information bit rate bars colored in orange.

The animation shows how the capacity and information bit rate of each eigenchannel evolve as a function of the SNR.

Parameters:
  • Nt (int) – Number of transmit antennas.

  • Nr (int) – Number of receive antennas.

  • snr_dB_list (array-like, shape (K,)) – List of SNR values in decibels (dB) for which to compute the capacity and information bit rate of the eigenchannels.

  • p_signal (float, optional) – The total available transmit power. Default is 1.0.

  • pa_strategy (str, optional) – The power allocation strategy to use. Must be one of the following: ‘optimal’, ‘equal’, ‘eigenbeamforming’. Default is ‘optimal’.

  • B (float, optional) – The available bandwidth in Hz. Default is 0.5 Hz.

  • R (float, optional) – The data rate. Represents the fraction of the eigenchannel capacity used for information transmission. Must be in the range [0, 1]. Default is 1.0 (i.e., using the full capacity).

  • c_type (str, optional) – The constellation type. Must be either ‘PAM’, ‘PSK’, or ‘QAM’. Default is ‘QAM’.

  • num_samples (int, optional) – The number of channel realizations used to compute the expected eigenchannel gains. Default is 10 million (1e7).

Returns:

animation – The animation object visualizing the capacity and information bit rate of the eigenchannels as a function of the SNR.

Return type:

matplotlib.animation.FuncAnimation