.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/mimo/plot_04_mimo_capacity.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_mimo_plot_04_mimo_capacity.py: Ergodic capacity of MIMO channels ================================= The capacity of a channel realisation with equal power on the :math:`n_t` antennas is :math:`\log_2\det(I + \frac{\rho}{n_t} H H^H)`; its mean over Rayleigh fading grows like :math:`\min(n_t, n_r) \log_2 \rho` at high SNR — one bit per 3 dB and per spatial stream (Foschini & Gans 1998, Telatar 1999). Water-filling on the eigenmodes, which needs the channel at the transmitter, helps at low SNR, where only the strongest modes deserve power. Antenna correlation (exponential, :math:`\rho = 0.9`) removes part of the multiplexing gain. .. GENERATED FROM PYTHON SOURCE LINES 13-54 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np import comnum snr = np.arange(-10.0, 31.0, 2.5) N = 4000 rng = comnum.Rng(17) fig, ax = plt.subplots() for n in [1, 2, 4]: h = comnum.mimo_channels(N, n, n, rng) (line,) = ax.plot(snr, [comnum.mimo_capacity(h, s).mean() for s in snr], label=f"{n} × {n}") if n == 4: ax.plot( snr, [comnum.mimo_capacity(h, s, water_filling=True).mean() for s in snr], color=line.get_color(), linestyle="--", linewidth=1.4, label="4 × 4, water-filling", ) hc = comnum.mimo_channels(N, 4, 4, rng, rx_correlation=0.9, tx_correlation=0.9) ax.plot( snr, [comnum.mimo_capacity(hc, s).mean() for s in snr], color=line.get_color(), linestyle=":", linewidth=1.4, label=r"4 × 4, correlated ($\rho$ = 0.9)", ) ax.set( xlabel=r"SNR $\rho$ (dB)", ylabel="ergodic capacity (bit/s/Hz)", xlim=(-10, 30), ylim=(0, None), title="i.i.d. Rayleigh fading", ) ax.legend() fig.tight_layout() .. image-sg:: /auto_examples/mimo/images/sphx_glr_plot_04_mimo_capacity_001.png :alt: i.i.d. Rayleigh fading :srcset: /auto_examples/mimo/images/sphx_glr_plot_04_mimo_capacity_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 55-56 At 20 dB, the capacity of 4 × 4 is close to four times that of a single antenna. .. GENERATED FROM PYTHON SOURCE LINES 56-59 .. code-block:: Python h1, h4 = comnum.mimo_channels(N, 1, 1, rng), comnum.mimo_channels(N, 4, 4, rng) c1, c4 = comnum.mimo_capacity(h1, 20.0).mean(), comnum.mimo_capacity(h4, 20.0).mean() print(f"1 × 1: {c1:.2f} bit/s/Hz, 4 × 4: {c4:.2f} bit/s/Hz, ratio {c4 / c1:.2f}") .. rst-class:: sphx-glr-script-out .. code-block:: none 1 × 1: 5.86 bit/s/Hz, 4 × 4: 22.19 bit/s/Hz, ratio 3.78 .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.290 seconds) .. _sphx_glr_download_auto_examples_mimo_plot_04_mimo_capacity.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_04_mimo_capacity.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_04_mimo_capacity.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_04_mimo_capacity.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_