5G Toolkit Logo
R24a.0.3

Contents:

  • Release Notes
  • Install 5G Toolkit
    • System Requirements:
    • Dependent Libraries
    • Install Miniconda
    • Install Jupyter Notebook
    • Install 5G Toolkit
    • Final Confirmation
    • License 5G Toolkit
    • Activate the 5G Toolkit License
    • Installation Tutorial: Video
  • Getting Started
    • Understanding API Documentation
    • Hello World!
      • Import Python Libraries
        • How to import 5G Toolkit Libraries
        • Create Objects for all the Modules
        • Generate Payload bits and Encode them
        • Symbol Mapping the Encoded Bits
        • Pass through AWGN Channel
        • Demapping the Symbols
        • Detect Error in the Blocks
        • Compute Bit and Block Error Rate
        • Constellation Diagrams at the Tx and Rx
        • Link Level Simulation
        • Bit/Block Error Rate Performance
    • Resources and Scripts
  • API Documentation
    • Sequence Generation
      • Primary Synchronization Signal
        • PSS
      • Secondary Synchronization Signal
        • SSS
      • Demodulation Reference Sequence (DMRS)
        • DMRS
      • Positioning Reference Sequence (PRS)
        • PRS
      • Channel State Information Reference Sequence (CSI-RS)
        • CSIRS
      • Sounding Reference Sequence (SRS)
        • SRS
          • SRS.lengthOfSequence
          • SRS.nrOfCyclicShift
          • SRS.nrofSymbols
          • SRS.sequenceId
          • SRS.slotIndex
          • SRS.startPosition
          • SRS.symbolIndices
          • SRS.transmissionComb
      • Pseudo Random (PN) Sequence
        • PNSequence
      • PUCCH Format 0 Sequence
        • PUCCHFormat0Sequence
          • PUCCHFormat0Sequence.controlInfo
          • PUCCHFormat0Sequence.indexPUCCH
          • PUCCHFormat0Sequence.initial_CyclicShift
          • PUCCHFormat0Sequence.m_CS
          • PUCCHFormat0Sequence.nID
          • PUCCHFormat0Sequence.numBatches
          • PUCCHFormat0Sequence.numInterlacedRBs
          • PUCCHFormat0Sequence.numRBs
          • PUCCHFormat0Sequence.numberOfSymb
          • PUCCHFormat0Sequence.pucch_GroupHopping
          • PUCCHFormat0Sequence.seqNumber
          • PUCCHFormat0Sequence.slotNumber
          • PUCCHFormat0Sequence.start_SymbIndex
      • PUCCH Format 1 Sequence
        • PUCCHFormat1Sequence
          • PUCCHFormat1Sequence.indexPUCCH
          • PUCCHFormat1Sequence.initial_CyclicShift
          • PUCCHFormat1Sequence.m_CS
          • PUCCHFormat1Sequence.maxNumPRBs
          • PUCCHFormat1Sequence.nHop
          • PUCCHFormat1Sequence.nID
          • PUCCHFormat1Sequence.numInterlacedRBs
          • PUCCHFormat1Sequence.numRBs
          • PUCCHFormat1Sequence.numberOfSymb
          • PUCCHFormat1Sequence.pucch_GroupHopping
          • PUCCHFormat1Sequence.slotNumber
          • PUCCHFormat1Sequence.start_SymbIndex
      • Low PAPR Sequence Type 1
        • LowPAPRSequenceType1
          • LowPAPRSequenceType1.baseSequenceNumber
          • LowPAPRSequenceType1.cyclicShift
          • LowPAPRSequenceType1.delta
          • LowPAPRSequenceType1.groupNumber
          • LowPAPRSequenceType1.lengthOfSequence
          • LowPAPRSequenceType1.numRBs
      • Low PAPR Sequence Type 2
        • LowPAPRSequenceType2
          • LowPAPRSequenceType2.cinit
          • LowPAPRSequenceType2.delta
          • LowPAPRSequenceType2.groupNumber
          • LowPAPRSequenceType2.groupNumber_Or_cinit
          • LowPAPRSequenceType2.lengthOfSequence
          • LowPAPRSequenceType2.numRBs
      • Primary Synchronization Signal for Sidelink (S-PSS)
        • S_PSS
      • Secondary Synchronization Signal for Sidelink (S-SSS)
        • S_SSS
    • Resource Mapping
      • Synchronization Signal Block (SSB) Grid Generation
        • SSB_Grid
          • SSB_Grid.displayGrid()
          • SSB_Grid.dmrsIndices
          • SSB_Grid.pbchIndices
          • SSB_Grid.pssIndices
          • SSB_Grid.sssIndices
      • Synchronization Signal Block (SSB) Resource Mapping
        • ResourceMapperSSB
      • Physical Downlink Shared Channel-DMRS
        • ResourceMapperDMRSPDSCH
          • ResourceMapperDMRSPDSCH.displayCDMPattern()
          • ResourceMapperDMRSPDSCH.displayResourceGrid()
      • Physical Downlink Shared Channel-PTRS
        • ResourceMapperPTRSPDSCH
      • Physical Downlink Control Channel (PDCCH)
        • ResourceMappingPDCCH
      • Control Resource Set
        • CORESET
          • CORESET.displayCoresetREG_CCE_Mapping()
      • Search Space Set
        • SearchSpaceSet
      • Channel state Information reference signal (CSI-RS)
        • ResourceMapperCSIRS
          • ResourceMapperCSIRS.displayCDMPattern()
          • ResourceMapperCSIRS.displayResourceGrid()
      • Positioning Reference Signal (PRS)
        • ResourceMapperPRS
      • Physical Uplink Control Channel (PUCCH)
        • PUCCH Format-0
          • PUCCH Format 0 Resource Mapping
          • PUCCH Format 0 Resource De-Mapping
        • PUCCH Format-1
          • PUCCH Format-1 Resource Mapping
          • PUCCH Format-1 Resource De-Mapping
          • PUCCH Format-1 Spreading
          • PUCCH Format-1 De-Spreading
        • PUCCH Format-2
        • PUCCH Format-3
        • PUCCH Format-4
      • Sidelink Synchronization Signal Block (SSB) Grid Generation
        • SSSB_Grid
          • SSSB_Grid.displayGrid()
      • Physical Sidelink Control Channel (PSCCH)
        • ResourceMappingPSCCH
    • Physical Channels
      • Physical Downlink Shared Channel (PDSCH)
        • PDSCH Transmitter
          • PDSCH: Upper Physical layer Chain
          • PDSCH: Lower Physical layer Chain
        • PDSCH Receiver
          • PDSCH: Upper Physical layer Chain Decoder
          • PDSCH: Lower Physical layer Chain Decoder
        • PDSCH Components
          • Transport Block Size Computation
          • Transport Block Processing
          • Code Block Segmentation
          • Low Density Parity Check Codes
          • Rate Matching
          • Code Block Concatenation
          • Scrambling: PDSCH
          • Modulation
          • Layer Mapper
          • Physical Downlink Shared Channel-DMRS
      • Physical Downlink Control Channel (PDCCH)
        • PDCCH Transmitter
          • PDCCH
        • PDCCH Receiver
          • PDCCHDecoder
        • PDCCH Components
          • Cyclic Redundency Check
          • RNTI Masking
          • Input Bit Interleaver
          • Polar Coder
          • Rate Matching
          • Scrambling: PDCCH
          • Modulation
      • Physical Broadcast Channel (PBCH)
        • PBCH Transmitter
          • PBCH
        • PBCH Receiver
          • PBCHDecoder
        • PBCH Components
          • Cyclic Redundency Check
          • RNTI Masking
          • Input Bit Interleaver
          • Polar Coder
          • Rate Matching
          • Scrambling: PDCCH
          • Modulation
      • Physical Uplink Shared Channel (PUSCH)
      • Physical Uplink Control Channel (PUCCH)
        • PUCCH Format 0
        • PUCCH Format 1
        • PUCCH Format 2
        • PUCCH Format 3
        • PUCCH Format 4
      • Physical Random Access Channel (PRACH)
      • Physical Sidelink Broadcast Channel (PSBCH)
        • PSBCH Transmitter
          • PSBCH
        • PSBCH Receiver
          • PSBCHDecoder
        • PSBCH Components
          • Cyclic Redundency Check
          • RNTI Masking
          • Input Bit Interleaver
          • Polar Coder
          • Rate Matching
          • Scrambling: PDCCH
          • Modulation
      • Physical Sidelink Control Channel (PSCCH)
        • PSCCH Transmitter
          • PSCCHUpperPhy
          • PSCCHLowerPhy
        • PSCCH Receiver
          • PSCCHUpperPhyDecoder
          • PSCCHLowerPhyDecoder
        • PSCCH Components
          • Cyclic Redundency Check
          • Input Bit Interleaver
          • Polar Coder
          • Rate Matching
          • Scrambling: PDCCH
          • Modulation
    • Payload Generation
      • Master Information Block (MIB)
        • MIB Generation
          • MIBGeneration
        • MIB Extraction
          • MIBExtraction
      • Downlink Control Information (DCI)
        • DCIGeneration
        • DCIExtraction
    • Forward Error Correction
      • Hamming Coder
        • Hamming coder
          • HammingEncoder
        • Hamming Decoder
          • HammingDecoder
        • Hamming Decoder - Sphere Decoding
          • HammingSphereDecoder
        • Hamming Decoder - Syndrome Based Decoding
          • HammingSyndromeDecoder
      • Low Density Parity Check Codes
        • LDPC Encoder
          • LDPCEncoder5G
        • LDPC Decoder
          • LDPCDecoder5G
        • LDPC Codec Subcomponents
          • LDPC Parameters Computation
          • Codeblock Processing: Transmitter
          • Codeblock Processing: Receiver
      • Polar Codes
        • Polar Encoder
          • PolarEncoder5G
        • Polar Decoder
          • PolarDecoder5G
        • Polar Codec Components
          • Code-block Processing: Transmitter
          • Code-block Processing: Receiver
          • Input Bit Interleavers
      • Reed Muller Codes
        • Reed Muller Encoder 5G
          • ReedMullerEncoder5G
        • Reed Muller Decoder 5G
          • ReedMullerDecoder5G
    • Rate matching
      • Rate matching for LDPC
        • Bit Selection for LDPC
          • Bit Selection
          • Bit De-selection
        • Bit Interleaver for LDPC
          • Bit Interleaver
          • Bit De-interleaver
        • RatematchParameters
          • RatematchParameters.baseGraph
          • RatematchParameters.enableLBRM
          • RatematchParameters.k0
          • RatematchParameters.liftingFactor
          • RatematchParameters.modOrder
          • RatematchParameters.numCodeBlocks
          • RatematchParameters.numCodedBits
          • RatematchParameters.numLayers
          • RatematchParameters.rvID
          • RatematchParameters.tbSize
      • Rate matching for Polar coder
        • Sub Block Interleaver for Polar Coder
          • Sub-block Interleaver
          • Sub-block De-interleaver
        • Bit Selection for Polar Coder
          • Bit Selection
          • Bit De-selection
        • Channel Interleaver for Polar Coder
          • Channel Interleaver
          • Channel De-interleaver
    • Interleavers
      • PBCH Interleaver
        • PBCH Interleaver
          • PBCHInterleaver
        • PBCH DeInterleaver
          • PBCHDeInterleaver
      • Input Bit Interleaver
        • Input Bit Interleaver
          • InputBitInterleaver
        • Input Bit DeInterleaver
          • InputBitDeInterleaver
      • Sub Block Interleaver
        • Sub Block Interleaver
          • Subblock_Interleaver
        • Sub Block Interleaver
          • Subblock_DeInterleaver
      • Channel Interleaver
        • Channel Interleaver
          • ChannelInterleaver
        • Channel De-interleaver
          • ChannelDeInterleaver
      • Bit Interleavers
        • Bit Interleaver
          • BitInterleaver
        • Bit Deinterleaver
          • BitDeinterleaver
    • Orthogonal Frequency Division Multiplexing
      • OFDM: Demodulator
        • OFDMDemodulator
      • OFDM: Modulator
        • OFDMModulator
      • Transform Decoding
        • TransformPrecoding
      • Transform Decoding for 5G
        • TransformDecoding5G
      • Transform Precoding
        • TransformPrecoding
      • Transform Precoding for 5G
        • TransformPrecoding5G
    • Channel Processing and Hardware Impairment
      • Apply Channel to Transmitted Signal
        • ApplyChannel
          • ApplyChannel.enableInterTxInterference
          • ApplyChannel.isFrequencyDomain
          • ApplyChannel.memoryConsumptionLevel
      • Add Noise and CFO at Receiver
        • AddNoise
    • Symbol Mapping
      • Mapper
        • Mapper
      • Demapper
        • Demapper
    • Scrambling
      • Scrambler
        • Scrambler
          • Scrambler.Lmax
          • Scrambler.c_init
          • Scrambler.id
          • Scrambler.mu
          • Scrambler.nID
          • Scrambler.purpose
          • Scrambler.q
          • Scrambler.rnti
          • Scrambler.ssbIndex
      • Descrambler
        • DeScrambler
          • DeScrambler.Lmax
          • DeScrambler.c_init
          • DeScrambler.id
          • DeScrambler.mu
          • DeScrambler.nID
          • DeScrambler.purpose
          • DeScrambler.q
          • DeScrambler.rnti
          • DeScrambler.ssbIndex
      • RNTI Masking
        • RNTImasking
          • RNTImasking.rnti
    • Channel Models
      • Antenna Array
        • AntennaArrays
        • Antenna Elements
          • 3GPP_38_901 Antenna Element
          • Hertzian Dipole Antenna Element
          • Linear Dipole Antenna Element
      • Node Mobility
        • NodeMobility
          • NodeMobility.displayRoute()
        • Mobility Models
          • Random-Walk
          • Circular Route
          • Vehicle Drops on HighWays
      • Simulation Layout
        • SimulationLayout
          • SimulationLayout.BSLocations
          • SimulationLayout.ISD
          • SimulationLayout.UELocations
          • SimulationLayout.UEdistibution
          • SimulationLayout.UEheightDistribution
          • SimulationLayout.bsAntennaArray
          • SimulationLayout.bsRoute
          • SimulationLayout.carrierFrequency
          • SimulationLayout.clutterDensity
          • SimulationLayout.clutterHeight
          • SimulationLayout.clutterSize
          • SimulationLayout.correlationDistanceIndoor
          • SimulationLayout.correlationDistanceLoS
          • SimulationLayout.correlationTypeIndoor
          • SimulationLayout.correlationTypeLoS
          • SimulationLayout.enableSpatialConsistencyIndoor
          • SimulationLayout.enableSpatialConsistencyLoS
          • SimulationLayout.force3GPPSpatialConsistencyParameters
          • SimulationLayout.forceLOS
          • SimulationLayout.heightOfBS
          • SimulationLayout.heightOfRoom
          • SimulationLayout.heightOfUE
          • SimulationLayout.indoorUEfraction
          • SimulationLayout.layoutLength
          • SimulationLayout.layoutType
          • SimulationLayout.layoutWidth
          • SimulationLayout.lengthOfIndoorObject
          • SimulationLayout.maxNumberOfFloors
          • SimulationLayout.memoryEfficient
          • SimulationLayout.minNumberOfFloors
          • SimulationLayout.minUEBSDistance
          • SimulationLayout.numOfBS
          • SimulationLayout.numOfSectorsPerSite
          • SimulationLayout.numOfSnapShots
          • SimulationLayout.numOfUE
          • SimulationLayout.radiusForCircularUEDrop
          • SimulationLayout.routeType
          • SimulationLayout.terrain
          • SimulationLayout.ueAntennaArray
          • SimulationLayout.ueDropMethod
          • SimulationLayout.ueRoute
          • SimulationLayout.widthOfIndoorObject
        • BS Layouts
          • Hexagonal Layout
          • Rectangular Layout
        • UE Drops
          • Rectangular Drop
          • Circular Drop
          • Hexagonal Drop
      • Channel Parameter Generator
        • ParameterGenerator
      • Channel Generator
        • ChannelGenerator
    • MIMO Processing
      • Code-Books
        • Type-1 Code-Book
          • TypeICodeBook
          • SearchFree
    • Scheduler
      • PDCCH Scheduler
        • PDCCHScheduler
      • Link Adaptation
        • LinkAdaptation
          • LinkAdaptation.selectMCS()
      • Rank Adaptation
        • RankAdaptation
      • Round Robin Scheduler
        • RoundRobinScheduler
          • RoundRobinScheduler.firstAcrossTime
          • RoundRobinScheduler.numRB
          • RoundRobinScheduler.numSymbol
          • RoundRobinScheduler.numUEscheduledAcrossFreq
          • RoundRobinScheduler.numUEscheduledAcrossTime
    • Cyclic Redundancy Check
      • CRC Encoder
        • CRCEncoder
      • CRC Decoder
        • CRCDecoder
    • Receiver Algorithms
      • Carrier Frequency Offset (CFO) Estimation
        • CarrierFrequencyOffsetEstimation
      • Channel Estimation and Symbol Equalization for PBCH
        • ChannelEstimationAndEqualizationPBCH
      • Channel Estimation and Symbol Equalization for PDCCH
        • ChannelEstimationAndEqualizationPDCCH
      • Channel Estimation and Symbol Equalization for PDSCH
        • ChannelEstimationAndEqualizationPDSCH
      • SSB Parameters Estimation
        • DMRSParameterDetection
      • Time Synchronization and PSS/Cell ID-2 Detection
        • PSSDetection
      • SSS/Cell ID-1 Detection
        • SSSDetection
      • Downlink Channel Estimation using CSI-RS
        • ChannelEstimationCSIRS
      • Uplink Channel Estimation using SRS for Positioning
        • ChannelEstimationSRS
    • Position Estimation
      • Position Estimation
        • PositionEstimation
      • Submodules
        • Time of Arrival (ToA)/Delay Estimation
          • ToAEstimation
          • DFT based Method
          • ESPRIT based ToA Estimation
          • MUSIC based ToA Estimation
        • Direction of Arrival Estimation
          • DoAEstimation
          • DFT based AoA Method
          • ESPRIT based DoA Estimation
          • MUSIC based DoA Estimation
        • Optimization Algorithms
          • Least Squares based Position Estimator for TDoA
          • Gradient Descent based Position Estimator for TDoA
          • Newton Raphson based Position Estimator for TDoA
          • Least Squares based Position Estimator for ToA/mRTT
          • Least Squares based Position Estimator for DoA
          • Gradient Descent based Position Estimator for DoA
          • Least Square based Position Estimator for Hybrid ToA/mRTT and DoA
          • Least Square based Position Estimator for Hybrid TDoA and DoA
    • 5G Configurations
      • Channel state information reference signal (CSI-RS) Configurations
        • CSIConfiguration
      • SSB/PBCH Configurations
        • GenerateValidSSBParameters
      • PDSCH Lower Physical Layer Configurations
        • PDSCHLowerPhyConfiguration
      • PDSCH Upper Physical Layer Configurations
        • PDSCHUpperPhyConfiguration
      • Sounding Reference Signal (SRS) Configurations
        • SRSConfiguration
          • SRSConfiguration.bHop
          • SRSConfiguration.bSRS
          • SRSConfiguration.betaSRS
          • SRSConfiguration.cSRS
          • SRSConfiguration.combOffset
          • SRSConfiguration.enableStartRBHopping
          • SRSConfiguration.freqDomainPosition
          • SRSConfiguration.freqDomainShift
          • SRSConfiguration.freqScalingFactor
          • SRSConfiguration.groupOrSequenceHopping
          • SRSConfiguration.lengthOfSequence
          • SRSConfiguration.nrOfCyclicShift
          • SRSConfiguration.nrofSRS_Ports
          • SRSConfiguration.nrofSymbols
          • SRSConfiguration.offsetInSlots
          • SRSConfiguration.periodicityInSlots
          • SRSConfiguration.purpose
          • SRSConfiguration.repetitionFactor
          • SRSConfiguration.resourceGridSizeinRBs
          • SRSConfiguration.resourceType
          • SRSConfiguration.sequenceId
          • SRSConfiguration.slotIndex
          • SRSConfiguration.startPosition
          • SRSConfiguration.startRBIndex
          • SRSConfiguration.symbolIndices
          • SRSConfiguration.systemFrameNumber
          • SRSConfiguration.transmissionComb
      • SSB/PBCH Configurations
        • SSBConfiguration
      • Time-Frequency 5G-Configurations
        • TimeFrequency5GParameters
          • TimeFrequency5GParameters.getGaurdBand_FR1()
          • TimeFrequency5GParameters.getGaurdBand_FR2()
          • TimeFrequency5GParameters.getNumberRB_FR1()
          • TimeFrequency5GParameters.getNumberRB_FR2()
  • Tutorials
    • Hamming Codes
      • Import Libraries
        • Python Libraries
        • 5G Toolkit Libraries
      • Hamming Codes Parameters
      • Simulation Setup
      • Performance Evaluation: SNR vs BER
      • Performance Evaluation: SNR vs BLER
      • Conclusions
    • Reed Muller Codes in 5G
      • Table of content:
      • Import Libraries
        • Python Libraries
        • 5G Toolkit Libraries
      • Mapper and Demapper Parameters
      • Simulation Parameters
      • Simulation
      • Performance Evaluation
        • Performance Plot: Averaged over 65 datasets of 5000 points each.
    • Polar Codes in 5G
      • Table of content:
      • Import libraries
        • Python Libraries
        • 5G Toolkit libraries
      • Symbol Mapping Configurations
      • Polar Coder Configurations
      • Simulation: AWGN Channel
      • Performance Evaluations
      • Performance Evaluations: Averaging over a 100 dataset of 100 points each
    • Low Density Parity Check (LDPC) Codes in 5G
      • Import Libraries
        • Python LIbraries
        • 5G Toolkit Libraries
      • Symbol Mapping Configurations
      • Simulation: Variation in Reliability with code-rate for fixed block-length
        • LDPC Parameters
        • Simulation Procedure
      • Performance Evaluation: BER vs SNR for different code-rates
      • Simulation: Variation in Reliability with block-length for fixed coderate
      • Performance Evaluation: BER vs SNR for different block lengths
      • Following results are averaged over 100 results
        • BER vs SNR
      • BER vs TB-size
    • Performance comparison of OFDM and DFT-s-OFDM in 5G Networks
      • Import Libraries
        • Import Python Libraries
      • Import 5G-Toolkit Libraries
      • Simulation Parameters
      • Peak to Average Power Ratio (PAPR) Analysis
        • PAPR Analysis: CP-OFDM
        • PAPR Analysis: DFT-s-OFDM
      • PAPR Performance Comparison: CP-OFDM vs DFT-s-OFDM
      • ACLR Analysis: CP-OFDM vs DFT-s-OFDM
      • ACLR Comparison of OFDM and DFT-s-OFDM
      • References
    • Detailed Tutorials on 3GPP Channel Models
      • Wireless Channel Generation for Outdoor Terrains deployed in Hexagonal Geometry
        • Import Libraries
          • Import Python Libraries
          • Import 5G Toolkit Libraries
        • Simulation Parameters
        • Generate Antenna Arrays
        • Generate Simulation Layout
        • Generate Channel Parameters
        • Generate Channel Coefficients
        • Generate OFDM Channel
          • Frequency Domain : Magnitude Response Plot
          • Time Domain Channel response
      • Wireless Channel Generation for a Dense High Indoor Factory Terrain Deployed at millimeter band.
        • Import Libraries
          • Import Python Libraries
          • Import 5G Toolkit Libraries
        • Simulation Parameters
        • Generate Antenna Arrays
        • Generate Simulation Layout
        • Generate Channel Parameters
        • Generate Channel Coefficients
        • Generate OFDM Channel
          • Frequency Domain : Magnitude Response Plot
          • Time Domain Channel response
      • Genarating the Wireless Channel for Indoor Open Office Terrain
        • Import Libraries
          • Import Python Libraries
          • Import 5G Toolkit Libraries
        • Simulation Parameters
        • Generate Antenna Arrays
        • Generate Simulation Layout
        • Generate Channel Parameters
        • Generate Channel Coefficients
        • Generate OFDM Channel
          • Frequency Domain : Magnitude Response Plot
          • Time Domain Channel response
      • Wireless Channel Generation for Outdoor Mobile User Connected to Rural Macro Site
        • Import Libraries
          • Python Libraries
          • 5G Toolkit Libraries
        • Simulation Parameters
        • Antenna Arrays
        • Node Mobility
        • Simulation Layout
        • Channel Parameters, Channel Coefficients and OFDM Channel
        • Variation in Channel Power across Time
        • Animation: Displaying the variation in receiver power of a UE time snapshots
          • Functions to Animate the Plot
          • Simulation Animation
          • Further Study
      • Channel Generation for Dual Mobility Scenarios in 5G and Beyond
        • Import Libraries
          • Import Python Libraries
          • Import 5G Libraries
        • Simulation Parameters
        • Generate Antenna Array
          • Generate Transmit Arrays
          • Generate Receiver Arrays
        • Generate the Routes
          • Generate the BS Routes
          • Generate the UE Routes
        • Simulation Layout
        • Channel Parameters, Channel Coefficients and OFDM Channel
        • Variation in Channel Power across Time
      • Wireless Channel Generation for Multiple Carrier Frequencies
        • Import Libraries
          • Python Libraries
          • 5G Toolkit Libraries
        • Simulation Parameters
        • Generate Antenna Array
        • Node Mobility
        • Generate Simulation Layout
        • Generate Channel Parameters
        • Generate Channel Coefficients
        • Generate OFDM Channel
          • Frequency Domain : Magnitude Response Plot
          • Time Domain Channel response
      • Propagation Characteristics of Outdoor Terrains
        • Simulation Parameters
        • Antenna Arrays
        • Simulation Layout
        • Compute the Rough estimate of the Probability of line of sight
        • Parameter Generator
        • Path-loss Characteristics
          • Distribution of Shadow fading
          • Probability Distribution of Rician K factor
        • Delay Spread Charateristics
        • Angular Spread Characteristics
          • Probability distribution of Azimuth-AoA
          • Probability distribution of Azimuth-AoD
          • Probability distribution of Elevation-AoA
          • Probability distribution of Elevation-AoD
      • Beam Domain and Delay Domain Sparsity in Wireless Channel Models
        • Import Libraries
          • Import Python Libraries
        • Import 5G Toolkit
        • Simulation Parameters
        • Antenna Arrays
          • Antenna Array at Rx
          • Antenna Array at Tx
        • Simulation Layout
        • Channel Parameters, Channel Coefficients and OFDM Channel
        • Demonstrating the Beam Domain Sparsity
        • Demonstrating the Delay Domain Sparsity
      • Generate Spatially Consistent Statistical Channels for Realistic Simulations
        • Import Libraries
          • Import Python Libraries
        • Import 5G Toolkit
        • Simulation Parameters
        • Antenna Arrays
          • Antenna Array at Rx
          • Antenna Array at Tx
        • Node Mobility
        • Simulation Layout
        • Channel Parameters, Channel Coefficients and OFDM Channel
        • Frequency Domain Consistency
          • Amplitude Spectrum: Each subcarrier accross time
          • Amplitude Spectrum: One subcarrier accross time
          • Amplitude Heatmap
          • Phase Spectrum
        • Doppler Domain Sparsity
        • Delay/Time Domain: Sparsity
    • Initial Access in 5G
      • Import Libraries
        • External Libaries
        • 5G Toolkit Modules
      • System Parameters
      • PBCH Information
      • Transmission-side Processing
        • Generate Primary Synchronization Sequence (PSS)
        • Generate Secondary Synchronization Sequence (SSS)
        • Generate Demodulation Reference Sequence (DMRS)
        • Generate the PBCH Payload
      • Constellation Diagram: Tx
        • Construct SSB Grid
        • Mapping SSB to Transmission Grid for ODFM
        • OFDM-Modulator
        • Analog Beamforming
      • Channel Generation
      • Pass Tx signal through Wireless Channel
      • Noise addition at receiver
      • SSB Receiver Side
        • Receiver combining
        • PSS Detection: largest peak
        • Largest peak
        • OFDM Demodulation: Resource Grid reconstruction
        • SSB Extaction from Resource Grid
        • Comparing Transmitted and Received SSB Grid
        • Spectrum Analysis
        • (SSS Detection: PSS channel assisted) + Cell-ID estimation
        • DMRS Parameters Detection + DMRS Sequence Generation
        • Channel Estimation and PBCH Symbol Equalization
      • Constellation Diagram: Rx
        • PBCH Decoding
        • Information Aggregation
      • Performance Evaluations: BER + Cell-IDs + DMRS Parameter Detection
        • Cell-IDs Detection
        • DMRS Parameter Detection
        • BER computation
    • Coverage Evaluation of Physical Broadcast Channels (PBCH) in 5G Networks
      • Import Libraries
        • Import Python Libraries
        • Import 5G Toolkit Libraiers
      • Simulation Parameters
      • Generate the Wireless Channel : CDL-A
      • Set SSB and Time-Frequency OFDM Configurations/Parameters
      • Generate the Synchronization Signal Block (SSB) Grid
      • Generate the Transmission Grid
      • Pass through the Wireless Channel
      • Display the Heatmap for the Received Grid
      • Link level Simulation: BLER for each SNR value
      • Block Error Rate Performance
      • Block Error Rate: Averaged over a 10000 batches
    • Link Level Simulation for Physical Downlink Control Channels
      • Import Libraries
        • Import Basic Python Libraries
      • Import 5G-Toolkit Libraries
      • Simulation Parameters
      • CORESET Parameters
      • Generate Wireless Channel: CDL-A
      • Link level Simulation: For each Aggregation level and Each SNR value
      • Reliability Performance: BER/BLER vs SNR
      • Reliability Performance: BER/BLER vs SNR for 20000 Batches
    • Link Level Simulation for Physical Downlink Shared Channel in 5G
      • Import Python Libraries
      • Import 5G-Toolkit Libraries
      • Simulation Parameters
      • Generate Channel
      • PDSCH Configurations
      • PDSCH Implementation
      • SVD based Precoding and Beamforming
      • Pass through the Wireless Channel
      • Recevier Side Processing
      • Simulation Results
      • Simulation Results: Averaged over 10000 batches
      • Save Results
    • BER Performance of PUCCH Format 0
      • Table of Contents
      • Import Libraries
        • Python Libraries
        • 5G ToolKit Libraries
      • Simulation Parameters
      • Format 0
      • Format 0 Decoder
      • M_CS Estimation
      • Information content based on MCS value
      • Simulation
      • Performance Evaluation
        • Performance Plot
    • SVD based Downlink Precoding and Combining for Massive MIMO 5G Networks
      • Import Python Libraries
        • Import Python Libraries
        • Import 5G-Toolkit Libraries
      • Simulation Parameters
      • Generate Wireless Channel: CDL-A
      • Link level simulation: BLER/BER/Throughput/SE vs SNR for different ranks
      • Simulation Results
      • Simulation Results: Averaged over 10000 batches
    • Type-1 codebook based Downlink Precoding and Combining for Massive MIMO 5G Networks
      • Import Python Libraries
        • Import Python Libraries
        • Import 5G-Toolkit Libraries
      • Simulation Parameters
      • Generate Wireless Channel: CDL-A
      • Link level simulation: BLER/BER/Throughput/SE vs SNR for different ranks
      • Simulation Results
      • Simulation Results: Averaged over 10000 batches
    • P1 Procedure: Beam management in 5G networks using SSB
      • Import librariers
        • Import Python libraries
        • Import 5G Toolkit libraries
      • Simulation Parameters
      • Generate Wireless Channel
      • Generate Time Frequency Parameters and MIB+ATI Parameters
      • Generate OFDM Resource/Transmission Grid
      • Pass through the Wireless Channel
      • Power Heatmap of Received Grid
      • Add Noise
      • RSRP Computation
      • Visualization of All Beam RSRP
      • Selected Base-station and Beam
      • Simulation Topology
    • Downlink Channel Estimation using CSI-RS
      • Import Python Libraries
        • Import Python Libraries
        • Import 5G-Toolkit Libraries
      • Simulation Parameters
      • Generate Channel
      • CSI Configurations
      • Generate CSI-RS Resource Grid
      • Generate the Transmit Grid
      • Transmit Beamforming
      • Pass through the Channel
      • Add noise at Receiver
      • Extract the Resource Grid
      • Estimate the Channel using CSI-RS
        • Display the Estimated channel
      • Estimate the Rank and Condition number
      • SVD of Channel and Condition number
      • Estimate the Precoder: Type-I
    • Search space, CORESET and blind decoding of PDCCH channels in 5G Networks
      • Import Libraries
        • Python Libraries
        • 5G Toolkit Libraries
      • Simulation Parameters
      • CORESET and Search Space Set Parameters
      • Transmitter Side Processing
      • Displaying Resource Grid
      • Wireless Channel : CDL-A
      • Receiver Side Processing and Blind Decoding of UE
    • Downlink Time of Arrival based Positioning in 5G and Beyond Networks
      • Positioning Procedure
      • Table of Content:
        • Import Libraries
      • Python Libraries
      • 5G Toolkit Libraries
        • Simulation Parameters
        • Channel Generation
      • Channel Parameters:
        • Position Reference Signal
        • OFDM Transmitter: Create Transmission Grid
      • Display Transmission Grid
        • Transmit Beamforming
        • Pass the Beamformed Grid Through Wireless Channel
        • Add Noise
        • Extracting the Resource Grid
        • Channel Estimation + Interpolation
      • Display the quality of Channel Estimates
        • ToA Estimation
      • Visualization: Time of Arrival locus Circles
        • Position Estimation + K-Best Measurement Selection (Genie Aided)
          • Measurement Selection:
      • Visualization of Positioning
        • Performance Analysis of Positioning Error for ToA based method
        • Performance Analysis: For 2000 UEs
        • Further Study
    • Downlink TDoA Based Positioning for Industrial IoT Devices in Millimeter Wave 5G Networks
      • Import Libraries
        • Python Libraries
        • 5G Toolkit Libraries
      • Simulation Parameters
      • Channel Generation
        • Channel Parameters:
      • Position Reference Signal
      • OFDM Transmitter: Create Transmission Grid
        • Display Transmission Grid
      • Transmit Beamforming
      • Pass the Beamformed Grid Through Wireless Channel
      • Add Noise
      • Extracting the Resource Grid
      • Channel Estimation + Interpolation
        • Display the quality of Channel Estimates
      • ToA Estimation
        • Visualization: Time of Arrival locus Circles
      • Position Estimation + K-Best Measurement Selection (Genie Aided)
        • Measurement Selection:
        • Visualization of Positioning
      • Performance Analysis of Positioning Error for ToA based method
      • Performance Analysis: For 2000 UEs
      • Further Study
    • Positioning the Outdoor UEs using 5G Urban Micro cell sites based Uplink Time Difference of Arrival (UL-TDoA) method
      • Import Libraries
        • Import Basic Python Libraries
        • Import 5G Toolkit Libraries
      • Simulation Parameters
      • Generate Wireless Channels
      • SRS Configurations
      • Slot by Slot Simulation
      • Position Estimation: Based on UL-ToA
      • Visualization of Estimated Position
      • Performance Analysis of Positioning Error for ToA based method
      • Performance Analysis: For 2000 UEs
    • Positioning the Indoor Open Office UEs using Uplink ToA method
      • Python Libraries
      • 5G Toolkit Libraries
      • Simulation Parameters
      • Generate Wireless Channels
      • SRS Configurations
      • Slot by Slot Simulation
      • Position Estimation: Based on UL-ToA
      • Visualization of Estimated Position
      • Performance Analysis of Positioning Error for Uplink-ToA based method
      • Performance Analysis: For 2000 UEs
    • Uplink AoA (UL-AoA) based Localization of the Indoor Factory UEs using millimeter 5G Networks
      • Python Libraries
      • 5G Toolkit Libraries
      • Simulation Parameters
      • Generate Wireless Channels
      • SRS Configurations
      • Slot by Slot Simulation
      • Position Estimation: Based on UL-ToA
      • Visualization: Direction of Arrival Locus Lines
      • Visualization of Estimated Position and its accuracy
      • Performance Analysis of Positioning Error for UL-AoA method
      • Performance Analysis for UL-AoA method: 1300 UEs
    • Downlink Angle of Departure based Positioning for Rural Macro Terrain in 5G and Beyond Network
      • Positioning Procedure
      • Table of Content:
        • Import Libraries
      • Python Libraries
      • 5G Toolkit Libraries
        • Simulation Parameters
        • Channel Generation
      • Channel Parameters:
        • Position Reference Signal
        • OFDM Transmitter: Create Transmission Grid
        • Compute the Measurement Windows
      • Transmit Beamforming
      • Add Noise
      • Pass the Beamformed Grid Through Wireless Channel
        • RSRP vs beam Index
      • AoD Estimation
        • Position Estimation + K-Best Measurement Selection (Genie Aided)
          • Measurement Selection:
      • Visualization of Positioning
        • Performance Analysis of Positioning Error for ToA based method
        • Performance Analysis for DL-AoD method: 2000 UEs
        • Further Study
  • Projects
    • Learning to Demap: Database Generation, Preprocessing, Postprocessing, Training, Validation and Inferences from the LLRNet
      • Table of Contents
      • Import Libraries
        • Import Python Libraries
        • Import 5G Toolkit Modules
      • Learning to Demap the Symbols
        • Input Output Mapping for M = 4
        • Input Output Mapping for M = 6
        • Input Output Mapping for M = 8
      • Throughput and BER Performance of LLRnet
        • Import Libraries
        • Simulation Parameters
        • PDSCH Parameters
        • LLRnet Parameters
          • Training Framework
          • Deployment Framework
      • Simulation Section
      • Performance Evaluation
        • Throughput vs SNR (dB) for 16-QAM, 64-QAM and, 256-QAM
        • Bit Error rate (BER) vs SNR (dB) for 16-QAM, 64-QAM and, 256-QAM
        • Block Error Rate (BLER) vs SNR (dB) for 16-QAM, 64-QAM and, 256-QAM
      • Performance Evaluation: 10000 batches and 64000 training samples for LLRNet
        • Throughput vs SNR (dB) for 16-QAM, 64-QAM and, 256-QAM.
        • Bit Error rate (BER) vs SNR (dB) for 16-QAM, 64-QAM and, 256-QAM.
        • Block Error rate (BER) vs SNR (dB) for 16-QAM, 64-QAM and, 256-QAM.
        • Complexity Analysis
      • Conclusion
        • Positives of the LLRnet:
        • Limitations of the LLRnet:
      • References:
    • Blockage Probability Analysis for RedCap Devices in 5G Networks
      • Analysis of Blocking Probability for different Coverage Conditions
        • Import Python Libraries
        • Import 5G Toolkit Libraries
        • Simulation Parameters
        • PDCCH Scheduling Parameters
        • PDCCH Scheduling for Good Coverage Scenarios
        • PDCCH Scheduling for Medium Coverage Scenarios
        • PDCCH Scheduling for Extreme Coverage Scenarios
        • Plotting the results
          • References
      • Variation in Blocking Probability with Different Aggregation Levels (ALs)
        • Python Libraries
        • 5G-Toolkit Libraries
        • Simulation Parameters
        • PDCCH Scheduling Parameters
          • Impact of AL 1
          • Impact of AL 2
          • Impact of AL 4
          • Impact of AL 8
          • Impact of AL 16
        • Plot the Variation in Blocking Probability with number of UEs for different Aggregation levels.
        • References
      • Analyzing the effect of Number of Candidates on Blocking Probability
        • Simulation Parameters
        • PDCCH Scheduling Parameters
        • Plot the Variation in Blocking Probability with number of PDCCH candidates
        • References
      • Analyzing the Impact of Scheduling Strategy on Blocking Probability
        • Python Libraries
        • 5G-Toolkit Libraries
        • Simulation Parameters
        • PDCCH Scheduling Parameters
        • Simulation for Scheduling Strategy-I
          • Blocking probability vs number of UEs to be scheduled.
        • Simulation for Scheduling Strategy-II
        • Plotting Blocking Probability vs Number of UEs for Scheduling Strategy
          • References
      • Analyze the Impact of UE Capability on Blocking Probability
        • Python Libraries
        • 5G-Toolkit Libraries
        • Simulation Parameters
        • PDCCH Scheduling Parameters
        • Simulating the Reference Case
          • Plot Blocking Probability for Different CORESET Sizes for Different UEs
        • Simulating Reduced Blind Decoding Case-A
        • Simulating Reduced Blind Decoding Case-B
        • Plot Blocking Probability for Different CORESET Sizes for Different UEs
          • References
      • Selection of minimum CORESET Size for a Given Target Block Probability
        • Python Libraries
        • 5G-Toolkit Libraries
        • Simulation Parameters
        • PDCCH Scheduling Parameters
        • Compute minimum coreset size for numUEs = 5.
        • Compute minimum coreset size for numUEs = 10.
        • Compute minimum coreset size for numUEs = 15.
        • Display Minimum CORESET size required to meet the Target Blocking Probability for different number of UEs.
          • References
    • Artificial Intelligence and Machine Learning (AI-ML) for CSI Compression and Reconstruction in 5G Networks
      • CSI Compression and Reconstruction using CSINet for TDD Massive MIMO 5G Networks
        • Import Libraries
          • Import Python Libraries
          • Import 5G Toolkit Libraries
        • Simulation Parameters
        • Wireless Channel Generation: CDL-A
        • Reconstrunction Performance of CSI-Net
        • PDSCH Parameters
        • PDSCH: Transmitter
        • SVD Based Beamforming: Perfect CSI
        • Pass through Channel
        • Link Level Simulation: SVD based Beamforming using Perfect CSI
        • SVD Based Beamforming: CSI Reconstructed using CSINet
        • Pass through Wireless Channel
        • Link Level Simulation: SVD based Beamforming using Imperfect CSI
      • Performance Evaluations
        • Throughput Evaluations
        • BLER Evaluations
        • References
      • Wireless Channel Dataset Generation for Training the AI based Models
        • Import Python Libraries
          • Import Basic Python LIbraries
          • Import 5G Toolkit Libraries
        • Simulation Parameters
        • Set Channel Parameters and Generate Common Parameters
        • Generate the Wireless Channels Databases and Preprocess it before storage.
        • Aggregate all the Datasets into a single Dataset
        • Display Sparsity of Wireless Channels
      • Training the CSINet
        • Import Libraries
          • Import Python Libraries
        • Important AI-ML Libraries
        • Load Datasets
        • Set Training Parameters
    • Comparative Study of Reed Muller codes, Polar Codes and LDPC codes
    • Link Level Simulations and Lnk budget Analysis for 5G Non Terrestrial Networks
      • Coverage Evaluation of Physical Broadcast Channels (PBCH) in 5G Non-Terrestrial Networks
        • Evaluation Methodology
          • Import Libraries
        • Import Python Libraries
        • Import 5G Libraries
          • Simulation Parameters
          • Generate NTN Channel
          • Generate MIB and PBCH Configurations for NTN
          • PSS, SSS, PBCH, PBCH-DMRS and SSB Generation
          • Transmission OFDM Resource Grid
          • Pass through the Wireless Channel
          • Heatmap of Received Grid
          • Link Level Simulation: PBCH
          • Displaying the Received Noisy Resource Grid
          • Displaying Noisy SSB Grid
          • Performance Evaluations: SNR vs BLER
      • Link Level Simulation for Physical Downlink Control Channels in 5G Non-Terrestrial Networks (NTN)
        • Import Libraries
          • Import Basic Python Libraries
        • Import 5G-Toolkit Libraries
        • Simulation Parameters
        • CORESET Parameters
        • Generate Wireless Channel: NTN-TDL-C
        • Link level Simulation: For each Aggregation level and Each SNR value
        • Reliability Performance: BER/BLER vs SNR
      • Link Level Simulation for Physical Downlink Shared Channel (PDSCH) in 5G Non Terrestrial Networks (NTN)
        • Import Python Libraries
        • Import 5G-Toolkit Libraries
        • Simulation Parameters
        • Generate Channel
        • PDSCH Configurations
        • PDSCH Implementation
        • Pass through the Wireless Channel
        • Recevier Side Processing
        • Simulation Results: Reliability
        • Simulation Results: Throughput
        • Simulation Results: Reliability (Averaged over 32000 batches)
        • Simulation Results: Throughput (Averaged over 32000 batches)
    • Hybrid Automatic repeat Request in 5G and Beyond
    • Constellation Learning in an AWGN Channel
      • PHY layer as AutoEncoder
      • Steps
        • Importing Libraries
        • Parameters of AutoEncoder
        • Training Data
        • Testing Data
        • Normalization Functions
        • Defining AutoEncoder Model
        • Training AutoEncoder
        • Defining Tx, Channel and Rx from Trained AutoEncoder
        • Block Error Rate (BLER) performance
        • Hamming Codes
      • Transmitter
      • BLER plot : comparison of AutoEncoder BLER with base line (n,k) Hamming Code BLER
        • Constellation Learning
      • learned constellation plot
        • References
    • Downlink Synchronization using SSB in 5G systems
    • Uplink Synchronization using PRACH in 5G systems
    • Performance comparison between different Positioning Methods for millimeter wave 5G Networks
      • Import Libraries
        • Import Python Libraries
        • Import 5G Toolkit Libraries
      • Simulation Parameters
      • Generate Wireless Channels
      • SRS Configurations
      • Slot by Slot Simulation
      • Position Estimation: Based on UL-ToA
      • Visualization of Estimated Position
      • Performance Analysis of Positioning Error for ToA based method
      • Positioning Results Averaged over 2000 UEs
  • Integration with Other Tools
    • Integration with SDRs
      • Time/OFDM Symbol Synchronization using PSS in 5G
        • Downlink Time/Frame Synchronization using PSS in 5G Networks
          • Import Libraries
          • Emulation Parameters
          • Generate SSB Parameters
          • Construct Transmission Grid and Generate Time Domain Samples
          • SDR-Setup Configurations
          • Transmission: SDR RF Transmitter
          • Reception: SDR RF Receiver
          • Time Synchronization: Based on PSS Correlation
          • Frame Synchronization: Visualization
          • Saving Running frames
        • [BS Side Implementation]-Downlink Time/Frame Synchronization using PSS in 5G Networks
          • Import Libraries
          • Emulation Parameters
          • Generate SSB Parameters
          • Construct Transmission Grid and Generate Time Domain Samples
          • SDR-Setup Configurations
          • Transmission: SDR RF Transmitter
        • [UE Side Implementation]-Downlink Time/Frame Synchronization using PSS in 5G Networks
          • Import Libraries
          • Emulation Parameters
          • SDR-Setup Configurations
          • Reception: SDR RF Receiver
          • Time Frequency Configurations
          • Time Synchronization: Based on PSS Correlation
      • Downlink Synchronization using SSB in 5G Networks
        • Downlink Synchronization in 5G Networks: SSB
          • Import Libraries
          • Emulation Configurations
          • Transmitter Implementation
          • Generate the SSB Grid for synchronization
          • Constellation Diagram
          • OFDM Modulation: Tx
          • SDR-Setup Configurations
          • Transmission: SDR RF Transmitter
          • Receiver Implementation
          • Reception: SDR RF Receiver
          • Time Synchronization: Based on PSS Correlation
          • OFDM Demodulation and SSB Extraction
          • SSB Grid: Transmitter and Receiver
          • Spectrum: Transmitted Grid and Received Grid
          • Parameter Estimation for SSB and PBCH
          • Channel Estimation and PBCH Symbol Equalization
          • PBCH Decoding and Constellation
          • Performance Verification
      • Downlink Data Communication using PDSCH in 5G Networks
        • Downlink Data Communication in 5G Networks
          • Import Python Libraries
          • 5G Toolkit Libraries
          • Simulation Parameters
          • PDSCH Transmitter Implementation
          • Generate the PDSCH related parameters: Use PDSCH Configurations
          • Generate the PDSCH Resource Grid
          • SSB Transmitter Implementation
          • Generate the SSB Resource Grid
          • SDR-Setup Configurations
          • Transmission: SDR RF Transmitter
          • Receiver Implementation: SSB
          • Reception: SDR RF Receiver
          • Time Synchronization: Based on PSS Correlation
          • PBCH Receiver
          • SSB Grid: Transmitter and Receiver
          • Spectrum: Transmitted Grid and Received Grid
          • PBCH Decoding and Constellation
          • Performance Verification
          • PDSCH Recourse Implementation
          • Extract PDSCH Resource Grid
          • PDSCH Receiver
          • Key Performance Indicators
    • Integration with MATLAB
      • Hamming Codes
        • Import Python Libraries: 5G-Toolkit and NumPy
        • Import Modules for Simulations: Demapper | Mapper | HammingEncoder | HammingDecoder
        • Hamming Code Configurations
        • Payload Generation
        • Hamming Encoder
        • Symbol Mapping
        • Link Level Simulation: SNR vs BLER
        • Performance Evaluation: SNR vs BLER
      • Downlink TDoA Based Positioning in 5G Networks
        • Import Python Libraries
        • Import 5G Toolkit Libraries
        • Simulation Parameters
        • Generate Wireless Channel
          • Generate Antenna Arrays
          • Generate Simulation Layout
          • Generate Channel Parameters | Generate Channels | OFDM Channel
        • Generate Positioning Reference Signal (PRS) and PRS Resource Grid
        • Generate OFDM Grid for Every BS
        • Beamform and Power Allocation
        • Pass through Channel
        • Add Noise
        • Extract Resource Grid
        • Channel Estimation using PRS
        • ToA Estimation
        • Position Estimation
        • Performance Evaluation
  • Learning Resources
    • Introductory Course on 5G Standards
    • Hardware Emulations using 5G Toolkit and SDRs
  • Tentetive list of Feature
    • In Progress (To be Released soon):
    • Next Quarter
    • Before September 2023
    • Before March 2024
  • Research work carried out using 5G Toolkit
  • Challenge Of this Week
    • Solution of this Months Problems
    • Arxiv-ed Challenges
  • License
    • Trademarks
    • Source Code
    • Content
  • Previous Versions
    • R23a
  • Discussion Forum
5G Toolkit
  • Integration with Other Tools
  • Integration with SDRs
  • Downlink Data Communication using PDSCH in 5G Networks
  • Downlink Data Communication in 5G Networks

YouTube logo Watch on YouTube View on GitHub Download notebook

Downlink Data Communication in 5G Networks

In this project we will demonstrate the transmission and reception of the data from base-station (BS) using low cost SDRs. The whole simulation consists of two parts:

Transmitter side:

  1. Generate the SSB block

  2. Generate the transport block ==> Process it with PDSCH chain ==> Create the slot resource grids

  3. Generate the resource grid and load SSB + PDSCH both into it.

  4. Pass the resource grid through the OFDM modulator: Generate the time domain I/Q samples.

  5. Pass it to the SDR and radiate the signal to the medium.

Receiver side: 1. Sample the medium to receive the samples and store thm in the buffer. 2. Downlink synchronization - This is performed using synchronization signal block (SSB). - Helps with - time/frame synchronization. - Coarse CFO correction. - Cell ID detection. - Decoding MIB information. 3. Data transmission and decoding -

SSB Transmitter

Import Python Libraries

[1]:
# %matplotlib widget

import os
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import matplotlib.pyplot as plt
import numpy as np
import adi

# from IPython.display import display, HTML
# display(HTML("<style>.container { width:98% !important; }</style>"))

5G Toolkit Libraries

[2]:
from toolkit5G.SequenceGeneration import PSS, SSS, DMRS
from toolkit5G.PhysicalChannels   import PBCH, PBCHDecoder
from toolkit5G.ResourceMapping    import SSB_Grid, ResourceMapperSSB
from toolkit5G.OFDM               import OFDMModulator, OFDMDemodulator
from toolkit5G.MIMOProcessing     import AnalogBeamforming, ReceiveCombining
from toolkit5G.ReceiverAlgorithms import PSSDetection, SSSDetection, DMRSParameterDetection
from toolkit5G.ReceiverAlgorithms import ChannelEstimationAndEqualizationPDSCH, ChannelEstimationAndEqualizationPBCH
from toolkit5G.Configurations     import TimeFrequency5GParameters, GenerateValidSSBParameters


from toolkit5G.PhysicalChannels.PDSCH import ComputeTransportBlockSize
from toolkit5G.PhysicalChannels       import PDSCHLowerPhy, PDSCHUpperPhy, PDSCHDecoderLowerPhy, PDSCHDecoderUpperPhy
from toolkit5G.Configurations         import PDSCHLowerPhyConfiguration, PDSCHUpperPhyConfiguration
from toolkit5G.SymbolMapping          import Mapper, Demapper
from toolkit5G.Scrambler              import DeScrambler, Scrambler
from toolkit5G.SymbolMapping          import Demapper
from toolkit5G.PhysicalChannels.PDSCH import LayerDemapper
from toolkit5G.PhysicalChannels.PDSCH import LayerDemapper

Simulation Parameters

[3]:
# Carrier Frequency
carrierFrequency = 1*10**9
numBatches    = 7        # Number of batches considered for simulation
scs           = 15*10**3   # Subcarrier Spacing for simulation
numBSs        = 1          # Number of BSs considered for simulation
bandwidth     = 30*10**6

# Number of UEs considered for simulation
numUEs        = numBatches # For now we are assuming that the numbatches are captured via numUEs
numRB         = 170         # Number of Resource mapping considered for simulation | # 1 RB = 12 subcarrier
slotNumber    = int(np.random.randint(0,2**(scs/15000)*10)) # Index of the slot considered for simulation
Nfft          = 2048       # FFTSize

Nt            = 1
print("************ Simulation Parameters *************")
print()
print("     numBatches: "+str(numBatches))
print("          numRB: "+str(numRB))
print("       fft Size: "+str(Nfft))
print("         numBSs: "+str(numBSs))
print("         numUEs: "+str(numUEs))
print("            scs: "+str(scs))
print("     slotNumber: "+str(slotNumber))
print("Num of Antennas: "+str(Nt))
print()
print("********************************************")
************ Simulation Parameters *************

     numBatches: 7
          numRB: 170
       fft Size: 2048
         numBSs: 1
         numUEs: 7
            scs: 15000
     slotNumber: 8
Num of Antennas: 1

********************************************

PDSCH Transmitter Implementation

PDSCH Transmitter

Generate the PDSCH related parameters: Use PDSCH Configurations

[4]:
######################################### PDSCH Lower Physical Layer Parameters #########################################
pdschMappingType       = 'PDSCH-mapping-type-A'   # "PDSCH mapping type A" or "PDSCH mapping type B"
maxLength              = 'len1'                   #
startSymbol            = 2                        #
numSymbols             = 12                       #
betaDMRS               = 1                        # 0 to 1
configurationType      = "Configuration-type-1"   # "Configuration-type-1" or "Configuration-type-2"
dmrsTypeAPosition      = "pos2"                   # "pos2" or "pos3"
dmrsAdditionalPosition = 'pos2'                   # "pos2" or "pos3"
ld                     = numSymbols
l0                     = startSymbol
l1                     = 11
rank                   = 1
pdschLowerPhyConfig    = PDSCHLowerPhyConfiguration(pdschMappingType = pdschMappingType, maxLength = maxLength,
                                                    betaDMRS = betaDMRS, configurationType = configurationType,
                                                    dmrsTypeAPosition = dmrsTypeAPosition, rank = rank,
                                                    dmrsAdditionalPosition = dmrsAdditionalPosition, l0 = l0, l1 = l1,
                                                    startSymbol = startSymbol, numSymbols= numSymbols, ld = ld)
scramblingID           = pdschLowerPhyConfig.scramblingID
nSCID                  = pdschLowerPhyConfig.nSCID


######################################### PDSCH Upper Physical Layer Parameters #########################################

numTBs                 = 1
mcsIndex               = 15
mcsTable               = 'pdschTable1'


pdschUpperPhyConfig    = PDSCHUpperPhyConfiguration(pdschMappingType = pdschMappingType, configurationType = configurationType,
                                                    dmrsTypeAPosition = dmrsTypeAPosition, maxLength = maxLength, numTBs = numTBs,
                                                    mcsIndex = mcsIndex, dmrsAdditionalPosition = dmrsAdditionalPosition, l0 = l0, mcsTable = mcsTable,
                                                    ld = ld, l1 = l1, startSymbol = startSymbol, numSymbols = numSymbols, rank = rank, numRB = numRB)

numTBs                 = pdschUpperPhyConfig.numTBs
mcsIndex               = pdschUpperPhyConfig.mcsIndex
mcsTable               = pdschUpperPhyConfig.mcsTable

numlayers              = pdschUpperPhyConfig.numlayers
tbLen1                 = pdschUpperPhyConfig.tbLen1
codeRate               = pdschUpperPhyConfig.codeRate
modOrder               = pdschUpperPhyConfig.modOrder

scalingField           = pdschUpperPhyConfig.scalingField
additionalOverhead     = pdschUpperPhyConfig.additionalOverhead
dmrsREs                = pdschUpperPhyConfig.dmrsREs
additionalOverhead     = pdschUpperPhyConfig.additionalOverhead

numTargetBits1         = pdschUpperPhyConfig.numTargetBits1
if(numTBs == 2):
    numTargetBits1     = pdschUpperPhyConfig.numTargetBits1
    numTargetBits2     = pdschUpperPhyConfig.numTargetBits2
    tbLen2             = pdschUpperPhyConfig.tbLen2

numTargetBits          = pdschUpperPhyConfig.numTargetBits
************ PDSCH Parameters *************

       pdschMappingType: PDSCH-mapping-type-A
            startSymbol: 2
             numSymbols: 12
               betaDMRS: 1
                   rank: 1
      configurationType: Configuration-type-1
              maxLength: len1
      dmrsTypeAPosition: pos2
 dmrsAdditionalPosition: pos2
           Duration, ld: 12
       Start symbol, l0: 2
     Start symbol-1, l1: 11
          num of Layers: 1

********************************************
********************************************
          tbsize-1: 51216

            numTBs: 1
            numCBs: 7
         numLayers: 1 | LayerperTB: [1 0]
             numRB: 170
          coderate: 0.6015625
          modOrder: 4
additionalOverhead: 0
numberTargetBits: 85680
********************************************

Generate the PDSCH Resource Grid

[5]:

pdschUpperPhy = PDSCHUpperPhy(symbolsPerSlot = numSymbols, numRB = numRB, mcsIndex = mcsIndex, numlayers = numlayers, scalingField = scalingField, additionalOverhead = additionalOverhead, dmrsREs = dmrsREs, numTBs=numTBs, pdschTable = mcsTable, verbose = False) codeword = pdschUpperPhy(tblock = [None, None], rvid = [0, 0], enableLBRM = [False, False], numBatch = numBatches, numBSs = numBSs) rnti = np.random.randint(65536, size=numBSs*numBatches) nID = np.random.randint(1024, size=numBSs*numBatches) bits2 = codeword[1] if numTBs == 2 else None pdschLowerPhyChain = PDSCHLowerPhy(pdschMappingType, configurationType, dmrsTypeAPosition, maxLength, dmrsAdditionalPosition, l0, ld, l1) resourceGrid = pdschLowerPhyChain(codeword[0], numRB, rank, slotNumber, scramblingID, nSCID, rnti, nID, modOrder, startSymbol, bits2 = bits2) ## Load the resource Grid into the transmision Grid txGrid = np.zeros(resourceGrid.shape[0:-1]+(Nfft,), dtype= np.complex64) bwpOffset = np.int32(0.5*(Nfft-numRB*12)) txGrid[...,bwpOffset:bwpOffset+numRB*12] = np.sqrt(1/rank)*resourceGrid txGrid = txGrid/(np.linalg.norm(np.abs(txGrid), axis=-1)[...,np.newaxis] + 0.0001) pdschLowerPhyChain.displayDMRSGrid(), pdschLowerPhyChain.displayResourceGrid()

../../../../_images/api_Integration_with_Other_Toolks_Integration_with_SDRs_4.Data_Communication_in_5G_5G_Data_Communication_using_PDSCH_9_1.png
[5]:
((<Figure size 640x480 with 2 Axes>,
  array([<Axes: title={'center': 'Port number: 0'}, xlabel='OFDM Symbol-Index', ylabel='Subcarrier-Index'>,
         <Axes: >], dtype=object)),
 None)
../../../../_images/api_Integration_with_Other_Toolks_Integration_with_SDRs_4.Data_Communication_in_5G_5G_Data_Communication_using_PDSCH_9_3.png
[6]:
# Plot Resource Grid
#################################################################
fig, ax = plt.subplots()
plt.imshow(np.abs(txGrid[0,0,0]), cmap = 'hot', interpolation='nearest', aspect = "auto")
ax = plt.gca();
ax.grid(color='c', linestyle='-', linewidth=1)
ax.set_xlabel("Subcarrier-Index (k)")
ax.set_ylabel("OFDM Symbol Index (n)")
ax.set_title("Heat map of Transmit Grid")
# Gridlines based on minor ticks
plt.show()
../../../../_images/api_Integration_with_Other_Toolks_Integration_with_SDRs_4.Data_Communication_in_5G_5G_Data_Communication_using_PDSCH_10_0.png

SSB Transmitter Implementation

SSB Transmitter

Generate the SSB Resource Grid

[7]:
## This class fetches valid set of 5G parameters for the system configurations
nSymbolFrame   = 14
numOFDMSymbols = 14
tfParams    = TimeFrequency5GParameters(bandwidth, scs)
tfParams(nSymbolFrame, typeCP = "normal")
nRB         = tfParams.numRBs        # SSB Grid size (Number of RBs considered for SSB transition)
Neff        = tfParams.Neff
lengthCP    = (tfParams.lengthCP).astype(np.int32)    # CP length
#___________________________________________________________________

#### Generate MIB Information
lamda                           = 3e8/carrierFrequency
nSCSOffset                      = 1
ssbParameters                   = GenerateValidSSBParameters(carrierFrequency, nSCSOffset, "caseA")

systemFrameNumber               = ssbParameters.systemFrameNumber
subCarrierSpacingCommon         = scs
ssbSubCarrierOffset             = ssbParameters.ssbSubCarrierOffset
DMRSTypeAPosition               = ssbParameters.DMRSTypeAPosition
controlResourceSet0             = ssbParameters.controlResourceSet0
searchSpace0                    = ssbParameters.searchSpace0

isPairedBand                    = ssbParameters.isPairedBand
nSCSOffset                      = ssbParameters.nSCSOffset
choiceBit                       = ssbParameters.choiceBit
ssbType                         = ssbParameters.ssbType
nssbCandidatesInHrf             = ssbParameters.nssbCandidatesInHrf
ssbIndex                        = ssbParameters.ssbIndex
hrfBit                          = ssbParameters.hrfBit
cellBarred                      = ssbParameters.cellBarred
intraFrequencyReselection       = ssbParameters.intraFrequencyReselection
withSharedSpectrumChannelAccess = ssbParameters.withSharedSpectrumChannelAccess

Nsc_ssb                         = 240
Nsymb_ssb                       = 4
#_______________________________________


N_ID2        = np.random.randint(3)

# Generate PSS sequence
pssObject    = PSS(N_ID2);
pssSequence  = pssObject()

N_ID1        = np.random.randint(336)
N_ID         = 3*N_ID1 + N_ID2

# Generate SSS sequence
sssObject    = SSS(N_ID1, N_ID2);
sssSequence  = sssObject()

# Generate DMRS sequence
dmrsLen      = 144;
dmrsObject   = DMRS("PBCH", N_ID, ssbIndex, nssbCandidatesInHrf, hrfBit)
# dmrsSeq = dmrs.getSequence("tensorflow")
dmrsSequence = dmrsObject(dmrsLen)


# Generate PBCH symbols
pbchObject   = PBCH(carrierFrequency, choiceBit, subCarrierSpacingCommon, DMRSTypeAPosition,
                   controlResourceSet0, searchSpace0, cellBarred, intraFrequencyReselection,
                   systemFrameNumber, ssbSubCarrierOffset, hrfBit, ssbIndex, N_ID,
                   nssbCandidatesInHrf)

pbchSymbols  = pbchObject()

## Generate SSB Object
ssbObject    = SSB_Grid(N_ID, True)
ssb          = ssbObject(pssSequence, sssSequence, dmrsSequence, pbchSymbols)

## Loading SSB to Resource Grid
#####################################
# ssbPositionInBurst = np.ones(nssbCandidatesInHrf, dtype=int)
ssbPositionInBurst    = np.zeros(nssbCandidatesInHrf, dtype=int)
ssbPositionInBurst[0] = 1

# ssbRGobject = ResourceMapperSSB(ssbType=ssbType, carrierFrequency = carrierFrequency, N_RB=nRB,
#                               kssb=0, offsetToPointA = int(nRB*0.5-10),
#                               scsCarrier = subCarrierSpacingCommon,
#                               ssbPositionInBurst = ssbPositionInBurst, ssbPeriodicity = None, nHF=None,
#                               nFrames = 0.1*(scs/subCarrierSpacingCommon), isPairedBand = isPairedBand,
#                               withSharedSpectrumChannelAccess = withSharedSpectrumChannelAccess)

# ssbGrid     = ssbRGobject(ssb[0])

ssbRGobject    = ResourceMapperSSB(ssbType=ssbType, carrierFrequency = carrierFrequency,
                                   isPairedBand = isPairedBand,
                                   withSharedSpectrumChannelAccess = withSharedSpectrumChannelAccess)

ssbGrid = ssbRGobject(ssb[0], ssbPositionInBurst, offsetInSubcarriers = ssbSubCarrierOffset[0],
                      offsetInRBs = int(0.5*nRB), numRBs = nRB)[0:14]
fig, ax = ssbObject.displayGrid(option=1)


numofGuardCarriers = (int((Nfft - Neff)/2), int((Nfft - Neff)/2))
offsetToPointA     = 0
firstSCIndex       = int(numofGuardCarriers[0] + offsetToPointA)

ssbResGrid = np.zeros((numOFDMSymbols, Nfft), dtype= np.complex64)
ssbResGrid[:, firstSCIndex:firstSCIndex+ssbGrid.shape[-1]] = ssbGrid

#__________________________________________________

## Concatenate the SSB and PDSCH Grid
X                 = np.concatenate([ssbResGrid, txGrid[:,0,0].reshape(-1,txGrid.shape[-1])], axis=0)

## OFDM Modulation at Transmitter
#####################################
modulator = OFDMModulator(lengthCP[1])
x_time    = modulator(X).flatten()
#______________________________________________________

# Plot Resource Grid
#################################################################
fig, ax = plt.subplots()
plt.imshow(np.abs(X).T, cmap = 'hot', interpolation='nearest', aspect = "auto")
ax = plt.gca();
ax.grid(color='c', linestyle='-', linewidth=1)
ax.set_xlabel("Subcarrier-Index (k)")
ax.set_ylabel("OFDM Symbol Index (n)")
ax.set_title("Heat map of Transmit Grid")
# Gridlines based on minor ticks
plt.show()
../../../../_images/api_Integration_with_Other_Toolks_Integration_with_SDRs_4.Data_Communication_in_5G_5G_Data_Communication_using_PDSCH_12_0.png
../../../../_images/api_Integration_with_Other_Toolks_Integration_with_SDRs_4.Data_Communication_in_5G_5G_Data_Communication_using_PDSCH_12_1.png
[8]:
numofGuardCarriers
[8]:
(64, 64)

SDR-Setup Configurations

[33]:
## SDR Parameters
sample_rate         = Nfft*scs

# Pulse Shaping
numSamplesPerSymbol = 1

# number of samples returned per call to rx()
buffer_size         = int(Nfft*1.2*numSamplesPerSymbol*112)

# Basic SDR Setup
sdr = adi.Pluto("ip:192.168.3.1")
sdr.sample_rate           = int(sample_rate)

# Config Tx
sdr.tx_rf_bandwidth       = int(30*10**6) # filter cutoff, just set it to the same as sample rate
sdr.tx_lo                 = int(carrierFrequency)
sdr.tx_hardwaregain_chan0 = -20 # Increase to increase tx power, valid range is -90 to 0 dB

# # Config Rx
# sdr.gain_control_mode_chan0 = 'manual'
# sdr.rx_hardwaregain_chan0   = 40.0      # dB
# # The receive gain on the Pluto has a range from 0 to 74.5 dB.

sdr.gain_control_mode_chan0 = 'slow_attack'
# # AGC modes:
#     # 1. "manual"
#     # 2. "slow_attack"
#     # 3. "fast_attack"

sdr.rx_lo           = int(carrierFrequency)
sdr.rx_rf_bandwidth = int(40*10**6) # filter width, just set it to the same as sample rate for now
sdr.rx_buffer_size  = int(4*buffer_size)
[34]:
np.abs(1.2*2**17*(x_time.repeat(1))).max(), np.abs(x_time).min()
[34]:
(11629.328723559462, 0.0)

Transmission: SDR RF Transmitter

[35]:

# Start the transmitter sdr.tx_cyclic_buffer = True # Enable cyclic buffers scalingFactor = 1.1*2**18 pulseShaping = 1 sdr.tx(scalingFactor*x_time) # start transmitting

Receiver Implementation: SSB

Receiver_Implementation

Reception: SDR RF Receiver

[36]:

# Clear buffer just to be safe for i in range (0, 10): raw_data = sdr.rx() # Receive samples rx_samples = sdr.rx() # # Stop transmitting sdr.tx_destroy_buffer()
[37]:
rx_samples.shape
[37]:
(1101004,)

Time Synchronization: Based on PSS Correlation

[38]:
## PSS Detection: Based on time domain PSS Correlation
# pssPeakIndices, pssCorrelation, rN_ID2 = pssDetection(r, Nfft, lengthCP = lengthCP[1],
#                                                       N_ID2 = None, freqOffset = ssboffset,
#                                                       height = 0.75, prominence = 0.65, width=10)
## PSS Detection: Based on time domain PSS Correlation
# pssDetection   = PSSDetection("correlation", "threshold")

pssDetection   = PSSDetection("largestPeak")
ssboffset      = int((Nfft-Neff)/2+ssbRGobject.startingSubcarrierIndices)
pssPeakIndices, pssCorrelation, rN_ID2, freqOffset = pssDetection(rx_samples, Nfft, lengthCP = lengthCP[1],
                                                                  nID2=None, freqOffset = ssboffset)

## PSS Detection Plot
#################################################################
scaleFig = 1.75
fig, ax  = plt.subplots(figsize=(30/scaleFig, 15/scaleFig))

# single line
ax.plot(pssCorrelation)
ax.vlines(x = pssPeakIndices, ymin = 0*pssCorrelation[pssPeakIndices],
           ymax = pssCorrelation[pssPeakIndices], colors = 'purple')
ax.set_ylim([0,np.max(pssCorrelation)*1.1])
ax.set_xlabel("Time Samples Index")
ax.set_ylabel("Amplitude of Time Domain Correlation")
ax.set_title("Amplitude (of Time Domain Correlation) vs Time-samples")
plt.show()
#________________________________________________________________
**(rasterOffset, PSS-ID) (1038, 0)
**(rasterOffset, PSS-ID) (1038, 1)
**(rasterOffset, PSS-ID) (1038, 2)
../../../../_images/api_Integration_with_Other_Toolks_Integration_with_SDRs_4.Data_Communication_in_5G_5G_Data_Communication_using_PDSCH_23_1.png

PBCH Receiver

  1. OFDM Demodulation

  2. SSS Dtection

  3. DMRS Parameters Detection

  4. Channel Estimation and PBCH Equalization

  5. PBCH Decoding and MIB Extraction

[39]:
## OFDM Demodulator Object
ofdmDemodulator = OFDMDemodulator(Nfft, lengthCP[1])
pssStartIndex   = pssPeakIndices
# pssStartIndex   = pssPeakIndices[0][0]
rxGrid          = ofdmDemodulator((rx_samples.reshape(1,-1))[...,pssStartIndex:(pssStartIndex+4*(Nfft+lengthCP[1]))])

ssbSCSoffset    = int((Nfft-Neff)/2+ssbRGobject.startingSubcarrierIndices)
ssbEstimate     = rxGrid[:,:,ssbSCSoffset:(ssbSCSoffset+240)]

## N_ID_1 Estimation: SSS based
sssDetection   = SSSDetection(method="channelAssisted", nID2=rN_ID2)
rN_ID1         = sssDetection(ssbEstimate[0])
rN_ID          = 3*rN_ID1 + rN_ID2

## Generate SSB object to get DMRS and PBCH Indices
rxSSBobject    = SSB_Grid(rN_ID)
rxDMRSIndices  = rxSSBobject.dmrsIndices

## Generate DMRS sequence
dmrsDetection  = DMRSParameterDetection(int(rN_ID), nssbCandidatesInHrf)
rssbIndex, rHrfBit = dmrsDetection(ssbEstimate[0])
rxDMRSobject   = DMRS("PBCH", int(rN_ID), int(rssbIndex), nssbCandidatesInHrf, rHrfBit)
rxDMRSseq      = rxDMRSobject(dmrsLen)

# ## Estimating the channel at DMRS (t-f) location, interpolting for data (t-f) location and equalizing the symbols
# ## Object for Channel Estimation
# chanEst        = ChannelEstimationAndEqualization(estimatorType = "ZF", interpolatorType = "NN")
# rxPBCHIndices  = rxSSBobject.pbchIndices
# pbchEstimate   = chanEst(ssbEstimate, rxDMRSseq, rxDMRSIndices, rxPBCHIndices, 10)

chanEst        = ChannelEstimationAndEqualizationPBCH(estimatorType = "ZF", interpolatorType = "Linear", isUEmobile=True)
pbchEstimate   = chanEst(ssbEstimate, rxDMRSseq, rN_ID)

## PBCH Chain for Decoding information
polarDecoder    = "SCL"
symbolDemapper  = "maxlog"
# extractMIBinfo = False
extractMIBinfo  = True
# carrierFreq, cellID, nssbCandidatesInHrf, ssbIndex, polarDecType, symbolDemapperType
pbchDecoder     = PBCHDecoder(carrierFrequency, int(rN_ID), nssbCandidatesInHrf, rssbIndex, polarDecoder, symbolDemapper)
rxMIB, check    = pbchDecoder(pbchEstimate, 10, extractMIBinfo)

<frozen toolkit5G.ChannelCoder.PolarCoder.polarDecoder>:494: UserWarning: Required ressource allocation is large for the selected blocklength. Consider option `cpu_only=True`.

SSB Grid: Transmitter and Receiver

[40]:
# Plot SSB
fig, ax = plt.subplots(1,2, figsize=(12.5, 5))
ax[0].imshow(np.abs(ssbEstimate[0]), cmap = 'hot', interpolation='nearest', aspect = "auto")
ax[0].grid(color='c', linestyle='-', linewidth=1)
ax[0].set_xlabel("Subcarrier-Index (k)")
ax[0].set_ylabel("Normalized Magnitude")

ax[1].imshow(np.abs(ssb[0]), cmap = 'hot', interpolation='nearest', aspect = "auto")
ax[1].grid(color='c', linestyle='-', linewidth=1)
ax[1].set_xlabel("Subcarrier-Index (k)")
ax[1].set_ylabel("Normalized Magnitude")
plt.title("Heat-map of Received and Transmitted SSB Grid")

plt.show()
../../../../_images/api_Integration_with_Other_Toolks_Integration_with_SDRs_4.Data_Communication_in_5G_5G_Data_Communication_using_PDSCH_27_0.png

Spectrum: Transmitted Grid and Received Grid

[41]:
# Plot SSB
fig, ax = plt.subplots(figsize=(12.5, 6))
ax.plot(np.abs(rxGrid[0][0])/np.abs(rxGrid[0][0]).max())
ax.plot(np.abs(X[2])/np.abs(X[2]).max())
ax.grid(color='c', linestyle='-', linewidth=1)
ax.set_xlabel("Subcarrier-Index (k)")
ax.set_ylabel("Normalized Magnitude")
ax.set_title("Magnitude Spreactrum of Transmitted and Received $1^{st}$ SSB OFDM Symbol")
plt.show()
../../../../_images/api_Integration_with_Other_Toolks_Integration_with_SDRs_4.Data_Communication_in_5G_5G_Data_Communication_using_PDSCH_29_0.png

PBCH Decoding and Constellation

[42]:
fig, ax = plt.subplots()
ax.scatter(np.real(pbchEstimate), np.imag(pbchEstimate), s = 12, label = "Equalized Symbols")
ax.scatter(np.real(pbchSymbols), np.imag(pbchSymbols), s = 12, label = "Transmitted Symbols")
ax.grid()
ax.axhline(y=0, ls=":", c="k", lw = 2); ax.axvline(x=0, ls=":", c="k", lw = 2)
ax.set_xlim([-1,1]); ax.set_ylim([-1,1])
ax.set_xlabel("Real {x}"); ax.set_ylabel("Imag {x}")
ax.set_title("Constellation Diagram: QPSK")
ax.legend(loc = "best")
plt.show()
../../../../_images/api_Integration_with_Other_Toolks_Integration_with_SDRs_4.Data_Communication_in_5G_5G_Data_Communication_using_PDSCH_31_0.png
[43]:
pbchDecoder.mibRx.displayParameters(0)
Carrier Frequency:      1000000000
ChoiceBit:              1
nSsbCandidatesInHrf:    4
subCarrierSpacingCommon:15000
DMRSTypeAPosition:      typeA
controlResourceSet0:    14
searchSpace0:           11
cellBarred:             barred
intraFreqReselection:   allowed
systemFrameNumber:      694
ssbSubCarrierOffset:    14
HRFBit:                 0
iSSBindex:              0
[44]:
pbchObject.mib.displayParameters(0)
Carrier Frequency:      1000000000
ChoiceBit:              1
nSsbCandidatesInHrf:    4
subCarrierSpacingCommon:15000
DMRSTypeAPosition:      typeA
controlResourceSet0:    14
searchSpace0:           11
cellBarred:             barred
intraFreqReselection:   allowed
systemFrameNumber:      694
ssbSubCarrierOffset:    14
HRFBit:                 0
iSSBindex:              0

Performance Verification

[45]:
if (rN_ID == N_ID):
    print("[Success]: Cell-IDs correctly detected!")
else:
    if (rN_ID1 != N_ID1 and rN_ID2 != N_ID2):
        print("[Failed]: Receiver couldn't detect the Cell-ID1 and cell-ID2 correctly!")
    elif(rN_ID1 != N_ID1):
        print("[Failed]: Receiver couldn't detect the Cell-ID1 correctly!")
    else:
        print("[Failed]: Receiver couldn't detect the cell-ID2 correctly!")

if (rssbIndex == ssbIndex[0]):
    print("[Success]: DMRS parameters correctly detected!")
else:
    print("[Failed]: Receiver couldn't detect the ssbIndex correctly!")

## Computing BER: Coded and Uncoded
numUEs = 1
nBatch = 1
uncodedBER     = np.zeros((numUEs, nBatch))
codedBER       = np.zeros((numUEs, nBatch))

bitEst         = pbchDecoder.llr.copy()
bitEst[pbchDecoder.llr  > 0]   = 1
bitEst[pbchDecoder.llr  < 0]   = 0
uncodedBER = np.mean(np.abs(bitEst - pbchObject.scr2bits[0]))
codedBER   = np.mean(np.abs(pbchDecoder.pbchDeInterleavedBits - pbchObject.mibSequence[0]))

print(" (uncoded-BER, codedBER): "+str((uncodedBER, codedBER)))
[Success]: Cell-IDs correctly detected!
[Success]: DMRS parameters correctly detected!
 (uncoded-BER, codedBER): (0.0, 0.0)

PDSCH Recourse Implementation

PDSCH Receiver

Extract PDSCH Resource Grid

[46]:
## OFDM Demodulator Object
ofdmDemodulator = OFDMDemodulator(Nfft, lengthCP[1])
pdschStartIndex = pssStartIndex+12*(Nfft+lengthCP[1])
# pssStartIndex   = pssPeakIndices[0][0]
rxGrid          = ofdmDemodulator((rx_samples.reshape(1,-1))[...,pdschStartIndex:(pdschStartIndex+14*7*(Nfft+lengthCP[1]))])

pdschGrid       = rxGrid[:,:,bwpOffset:bwpOffset+numRB*12].reshape(numBatches,1,14,-1)

# Plot SSB
fig, ax = plt.subplots(figsize=(12.5, 7.5))
plt.imshow(np.abs(pdschGrid[0,0]), cmap = 'hot', interpolation='nearest', aspect = "auto")
ax = plt.gca();
ax.grid(color='c', linestyle='-', linewidth=1)
ax.set_xlabel("Subcarrier-Index (k)")
ax.set_ylabel("Normalized Magnitude")
ax.set_title("Heat-map of Received and SSB Grid")
plt.show()
../../../../_images/api_Integration_with_Other_Toolks_Integration_with_SDRs_4.Data_Communication_in_5G_5G_Data_Communication_using_PDSCH_37_0.png

PDSCH Receiver

[53]:
# Channel Estimation and Equalization
chEst = ChannelEstimationAndEqualizationPDSCH(slotNumber, scramblingID, nSCID, rnti, nID,
                                              pdschMappingType, configurationType, dmrsTypeAPosition,
                                              maxLength, dmrsAdditionalPosition, l0, ld, l1, startSymbol)
interpolator = "Linear" # Can be "Spline" | "Linear" | "Cubic"
polyOrder    = 3 # Required only for Spline, Will be ignored for other interpolators
rsymbols     = chEst(pdschGrid, interpolator, polyOrder)

#### Layer Demapping
layDemap     = LayerDemapper(numTBs, rank)
rlmSym       = layDemap(rsymbols)  # received symbols

######## Demapping.
demapMethod  = "app" # Demapping method
constType    = "qam"  # Symbol mapping type
modOrder     = modOrder       # Mordulation order or number of bits per symbol
snr          = 1000
hard_out     = False
demapper     = Demapper(demapMethod, constType, modOrder, hard_out = hard_out)

## Computed Received bits
rxLLRs      = demapper([np.complex64(rlmSym), 1/snr])

## Descrambling
if hard_out:

    scrObject = Scrambler("PDSCH", rnti, 0, nID)
    rxBits    = scrObject(rxLLRs)

else:
    scrObject = DeScrambler("PDSCH", rnti, 0, nID)
    rscrBits  = scrObject(rxLLRs)
    rxBits    = np.where(rscrBits>0, 1, 0)

# PDSCH Upper Physical layer Decoder
pdschUpPhyDec = PDSCHDecoderUpperPhy(numTBs = numTBs, mcsIndex = mcsIndex, symbolsPerSlot= numSymbols,
                                     numRB  = numRB, numLayers = numlayers, scalingField = scalingField,
                                     additionalOverhead = additionalOverhead, dmrsREs = dmrsREs,
                                     enableLBRM = [False, False], pdschTable = mcsTable, rvid = [0, 0], verbose=False)
rbits         = pdschUpPhyDec([rscrBits])

Constellation Diagram

[54]:
fig, ax = plt.subplots(figsize=(7.5, 7.5))

ax.scatter(np.real(rsymbols),
           np.imag(rsymbols), s=48, label="Received Constellation")
ax.scatter(np.real(resourceGrid[pdschLowerPhyChain.pdschIndices]),
           np.imag(resourceGrid[pdschLowerPhyChain.pdschIndices]),
           s=48, label="Transmitted Constellation")
ax.axhline(y=0, ls=":", c="k"); ax.axvline(x=0, ls=":", c="k")
ax.set_xlim([-1.5,1.5]); ax.set_ylim([-1.5,1.5])
ax.set_xlabel("Real {x}"); ax.set_ylabel("Imag {x}")
ax.set_title("Constellation Diagram: 16-QAM")
ax.grid();
ax.legend(loc = "best")
plt.show()
../../../../_images/api_Integration_with_Other_Toolks_Integration_with_SDRs_4.Data_Communication_in_5G_5G_Data_Communication_using_PDSCH_41_0.png

Key Performance Indicators

  1. Data-rate Indicators

    • Thoughput (Bits per seconds)

    • Spectral Efficency (Bits per second per Hertz)

  2. Reliability

    • Block Error Rate (BLER)

    • Bit Error Rate (BER)

[55]:
# Reliability Metrics
codedBER          = np.mean(np.abs(rbits[0][:,np.newaxis]-pdschUpperPhy.tblock1))
uncodedBER        = np.mean(np.abs(codeword[0][:,0,:] - rxBits))
bler              = 1-np.mean(pdschUpPhyDec.crcCheckTBs)

# Data rate Metrics
slotDuration      = 10**(-3)*15000/(scs)
throughput        = (1-bler)*numBatches*pdschUpperPhy.tbLen1/(slotDuration*(numBatches+1))
spectalEfficiency = throughput/bandwidth

print()
print("         Throughput: "+str(throughput/10**6)+" Mbps")
print("Spectral Efficiency: "+str(spectalEfficiency)+" bits per second per Hz")
print()
print("*********************** Reliability ***********************")
print("   Block Error Rate: "+str(bler))
print("     Bit Error Rate: "+str(codedBER))
print()


         Throughput: 38.412 Mbps
Spectral Efficiency: 1.2804 bits per second per Hz

*********************** Reliability ***********************
   Block Error Rate: 0.1428571428571429
     Bit Error Rate: 2.7893069130182532e-06

[ ]:

[ ]:

Previous Next

© Copyright 2022-2024, Gigayasa Wireless Private Limited.

Built with Sphinx using a theme provided by Read the Docs.