{ "cells": [ { "cell_type": "markdown", "id": "b7e0a807", "metadata": {}, "source": [ "# Creating random CDL channels for a dataset" ] }, { "cell_type": "code", "execution_count": 1, "id": "b5013617", "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import scipy.io\n", "import time\n", "\n", "from neoradium import Carrier, CdlChannel, AntennaPanel, random" ] }, { "cell_type": "markdown", "id": "ae25ab80-ce3a-4606-9589-e3ccb83fa93e", "metadata": {}, "source": [ "## Create 1000 MIMO CDL channels" ] }, { "cell_type": "code", "execution_count": 3, "id": "395f5ffc-99d0-4793-931f-02ca69ec0677", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "shape of 'allChannels': (1000, 14, 300, 4, 16)\n" ] } ], "source": [ "# First create a carrier object with 25 PRBs and 15KHz subcarrier spacing\n", "carrier = Carrier(startRb=0, numRbs=25, spacing=15)\n", "\n", "# Now create the generator\n", "chanGen = CdlChannel.getChanGen(1000, carrier.curBwp, # Number of channels and bandwidth part\n", " profiles=\"ABCDE\", # Randomly pick a CDL profile\n", " delaySpread=(10,500), # Uniformly sample beween 10 and 500 ns\n", " ueSpeed=(5,20), # Uniformly sample beween 5 and 20 mps\n", " ueDir=[45, 135, 225, 315], # Randomly pick one of these UE directions\n", " carrierFreq=4e9, # Carrier frequency\n", " txAntenna=AntennaPanel([2,4], polarization=\"x\"), # 16 TX antenna\n", " rxAntenna=AntennaPanel([1,2], polarization=\"x\"), # 4 RX antenna\n", " seed=123)\n", "\n", "# create the channel matrices\n", "allChannels = np.stack([chan for chan in chanGen]) \n", "print(f\"shape of 'allChannels': {allChannels.shape}\") " ] }, { "cell_type": "code", "execution_count": null, "id": "94b6c9fd-9c58-4c7b-9686-ac168a38b241", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.6" } }, "nbformat": 4, "nbformat_minor": 5 }