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
  • Tutorials
  • Downlink TDoA Based Positioning for Industrial IoT Devices in Millimeter Wave 5G Networks

YouTube logo Watch on YouTube View on GitHub Download notebook

Downlink TDoA Based Positioning for Industrial IoT Devices in Millimeter Wave 5G Networks

This tutorial estimates the position of based time of arrival estimates. The details of the tutorial simulation parameters is shown below:

Parameters

Values

Positioning Method

DL-TDoA based

Parameter Estimation Method

ESPRIT

Optimization Method

Gradient Descent

Carrier Frequency

28 GHz

Bandwidth

150 MHz

Subcarrier Spacing

120 kHz

Terrain

Indoor-Factory (InF-SH)

Channel State Information

Zero Forcing + Spline Interpolation

Reference Signal

Positioning Reference Signal (PRS)

Simulation Type

System Level Simulation

The tutorial will generate 5G standards compliant reference signal (PRS) which is transmitted by BS foe UE to perform measurement which inturn can be used to estimate the location of the UE. Users can generate the Wireless channel either using our tool which has one of the most exhaustive channel modelling library or use some other \(3^{rd}\) party tool such as Sionna, Quadriga to generate the channel and use it with 5G Toolkit.

Positioning Procedure

  • Generate the Reference Signal

  • Transmit the Reference Signal

  • Pass the Transmit Signal through Wireless Channel

  • Add Noise at the Receiver

  • Estimate the Channel at Pilot Locations

  • Interpolate the channel at remaining locations

  • Estimate the Delays (Time of arrival using the channel Estimates)

  • Estimate the Position using ToA estimates.

  • Select the most accurate measurements for Positioning.

  • Compute Time Difference of Arrival (TDoA) measurements.

  • Estimate position of the UEs based on TDoA measurements.

Finally, we will demonstrate the efficacy of these methods using simulation evaluation results:

  • Horizontal (2D) Positioning Accuracy vs SNR

  • Verical Positioning Accuracy vs SNR

  • 3D Positioning Accuracy

Table of Content:

  • Import Libraries

    • Python Libraries

    • 5G Toolkit Libraries

  • Simulation Parameters

  • Channel Generation

  • Positioning Reference Signal

  • OFDM Transmitter: Create Transmission Grid

    • Display Transmission Grid

  • Transmit Beamforming

  • Pass the Beamformed Grid Through Wireless Channel

  • Add Noise

    • Display Received Resource Grid

  • Extracting the Resource Grid

  • Channel Estimation + Channel 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

  • Further Study

Import Libraries

Python Libraries

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

import os
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'

# %matplotlib widget
import matplotlib.pyplot  as plt
import matplotlib.patches as mpatches
import matplotlib as mpl

import numpy      as np
from   scipy import interpolate

5G Toolkit Libraries

[2]:
import sys
sys.path.append("../../../")

from toolkit5G.ChannelModels     import AntennaArrays, SimulationLayout, ParameterGenerator, ChannelGenerator
from toolkit5G.ResourceMapping   import ResourceMapperPRS
from toolkit5G.Positioning       import ToAEstimation, LeastSquareTDoA, LeastSquareToA
from toolkit5G.ChannelProcessing import AddNoise

Simulation Parameters

Parameters

Values

Terrain

Indoor Factory Sparse High (InF-SH)

Carrier Frequency

28 GHz

Subcarrier Spacing

30 kHz

Number of Base-station

21 (7 sites with 3 sectors each)

BS Deployment

Hexagonal

UE Dropping

Uniformly at random in the hall

Number of UEs

100

Bandwidth

30 MHz (85 RBs)

Number of RBs

85

[3]:
propTerrain      = "InF-SH"         # Propagation Scenario or Terrain for BS-UE links
carrierFrequency = 28*10**9         # Array of two carrier frequencies in GHz
scs              = 120*10**3
Nfft             = 1024
numOfBSs         = np.array([6,3], dtype=int) # number of BSs
nBSs             = 18 # np.prod(numOfBSs)
nUEs             = 100               # number of UEs
Bandwidth        = 150*(10**6)
numRBs           = 85

print()
print("*****************************************************")
print("                   Terrain: "+str(propTerrain))
print("             Number of UEs: "+str(nUEs))
print("             Number of BSs: "+str(numOfBSs))
print("         carrier Frequency: "+str(carrierFrequency/10**9)+" GHz")
print("                 Bandwidth: "+str(Bandwidth))
print(" Number of Resource Blocks: "+str(numRBs))
print("        Subcarrier Spacing: "+str(scs))
print("                  FFT Size: "+str(Nfft))
print("*****************************************************")
print()


*****************************************************
                   Terrain: InF-SH
             Number of UEs: 100
             Number of BSs: [6 3]
         carrier Frequency: 28.0 GHz
                 Bandwidth: 150000000
 Number of Resource Blocks: 85
        Subcarrier Spacing: 120000
                  FFT Size: 1024
*****************************************************

Channel Generation

Channel Parameters:

  1. Intersite Distance: 200m

  2. BS is deployed at 35m and UE has a random height between 0 and 1.5m.

  3. BS Antennas Arrays:

    • Antenna Types: Parabolic

    • Number of Panels: 1

    • Number of Antennas: 2 Horizontally, 2 Verically

    • Polarization: 1 (Monopole)

  4. UE Antennas Arrays:

    • Antenna Types: Hertizian (Omni)

    • Number of Panels: 1

    • Number of Antennas: 4 Horizontally, 4 Verically

    • Polarization: 1 (Monopole)

  5. Mobility: No Mobility

  6. OFDM Channel:

    • Carrier Phase: Disabled.

    • \(\text{N}_\text{fft}\): 1024

[4]:
# Antenna Array at UE side
# assuming antenna element type to be "OMNI"
# with 2 panel and 2 single polarized antenna element per panel.
ueAntArray = AntennaArrays(antennaType = "OMNI",  centerFrequency = carrierFrequency,
                           arrayStructure  = np.array([1,1,4,4,1]))
ueAntArray()

# # Radiation Pattern of Rx antenna element
# ueAntArray.displayAntennaRadiationPattern()

# Antenna Array at BS side
# assuming antenna element type to be "3GPP_38.901", a parabolic antenna
# with 4 panel and 4 single polarized antenna element per panel.
bsAntArray = AntennaArrays(antennaType = "3GPP_38.901", centerFrequency = carrierFrequency,
                           arrayStructure  = np.array([1,1,2,2,1]))
bsAntArray()

# # Radiation Pattern of Tx antenna element
# bsAntArray[0].displayAntennaRadiationPattern()

# Layout Parameters
isd                  = 20           # inter site distance
minDist              = 0            # min distance between each UE and BS
ueHt                 = 1.5           # UE height
bsHt                 = 3            # BS height
bslayoutType         = "Rectangular"   # BS layout type
ueDropType           = "Rectangular"   # UE drop type
htDist               = "random"      # UE height distribution
ueDist               = "random"       # UE Distribution per site
nSectorsPerSite      = 1             # number of sectors per site
maxNumFloors         = 3             # Max number of floors in an indoor object
minNumFloors         = 1             # Min number of floors in an indoor object
heightOfRoom         = 5.1           # height of room or ceiling in meters
indoorUEfract        = 0.5           # Fraction of UEs located indoor
lengthOfIndoorObject = 3             # length of indoor object typically having rectangular geometry
widthOfIndoorObject  = 3             # width of indoor object
forceLOS             = True          # boolen flag if true forces every link to be in LOS state
# forceLOS             = False       # boolen flag if true forces every link to be in LOS state

# simulation layout object
simLayoutObj = SimulationLayout(numOfBS = numOfBSs,
                                numOfUE = nUEs,
                                heightOfBS = bsHt,
                                heightOfUE = ueHt,
                                ISD = isd,
                                layoutType = bslayoutType,
                                layoutWidth = 50,
                                layoutLength = 120,
                                ueDropMethod = ueDropType,
                                UEdistibution = ueDist,
                                UEheightDistribution = htDist,
                                numOfSectorsPerSite = nSectorsPerSite,
                                ueRoute = None)

simLayoutObj(terrain = propTerrain,
             carrierFreq = carrierFrequency,
             ueAntennaArray = ueAntArray,
             bsAntennaArray = bsAntArray,
             indoorUEfraction = indoorUEfract,
             heightOfRoom = heightOfRoom,
             lengthOfIndoorObject = lengthOfIndoorObject,
             widthOfIndoorObject = widthOfIndoorObject,
             maxNumberOfFloors = maxNumFloors,
             forceLOS = forceLOS)

# displaying the topology of simulation layout
fig, ax = simLayoutObj.display2DTopology()
ax.set_xlabel("x-coordinates (m)")
ax.set_ylabel("y-coordinates (m)")
ax.set_title("Simulation Topology")
# ax.axhline(y=-0.5*isd*numOfBSs[1], xmin=10/140, xmax=130/140, color="k")
# ax.axhline(y= 0.5*isd*numOfBSs[1], xmin=10/140, xmax=130/140, color="k")
# ax.axvline(x=-0.5*isd*numOfBSs[0], ymin=10/140, ymax=130/140, color="k")
# ax.axvline(x= 0.5*isd*numOfBSs[0], ymin=10/140, ymax=130/140, color="k")

paramGen = simLayoutObj.getParameterGenerator(muKdB=-9, sigmaKdB=0.25)

# paramGen.displayClusters((0,0,0), rayIndex = 0)
channel = paramGen.getChannel()
Hf      = channel.ofdm(scs, Nfft)[0]

Nt        = bsAntArray.numAntennas # Number of BS Antennas
Nr        = ueAntArray.numAntennas

../../../_images/api_Tutorials_Tutorial21%2B_E2E_Downlink_TDoA_Based_Positioning_for_millimeter_Wave_5G_Networks_Deployed_in_Indoor_Factory_8_0.png
[5]:
bsAntArray.displayAntennaRadiationPattern()
../../../_images/api_Tutorials_Tutorial21%2B_E2E_Downlink_TDoA_Based_Positioning_for_millimeter_Wave_5G_Networks_Deployed_in_Indoor_Factory_9_0.png
[5]:
(<Figure size 960x480 with 1 Axes>, <Axes3D: >)

Position Reference Signal

  • Number of OFDM symbols occupied by PRS: dl_PRS_NumSymbols

  • COMB size-N for PRS Transmission: dl_PRS_CombSizeN

  • PRS symbol offset: dl_PRS_ResourceSymbolOffset

  • Resource Element offset in PRS: dl_PRS_ReOffset

  • PRS Resource-ID: dl_PRS_SequenceID

  • Index of the Slot which will carry the PRS resource Grid: slotNumber

  • Power scaling factor of PRS per ofdm symbol: betaPRS

  • PRS Resource Grid: (prsGrid) - \(\text{N}_\text{BS} \times 14*\text{numSlots} \times 12*\text{numRBs}\)

[6]:
dl_PRS_NumSymbols           = 12   # Number of OFDM symbols occupied by PRS
dl_PRS_CombSizeN            = 12   #12 # COMB size-N
dl_PRS_ResourceSymbolOffset = 0    # PRS symbol offset
dl_PRS_ReOffset             = 0    # RE offset in PRS    # not considered
dl_PRS_SequenceID           = 231  # PRS Sequence ID.

# Number of slots per frame
numBSsPerSlot               = dl_PRS_CombSizeN
numSlots                    = int(np.ceil(nBSs/numBSsPerSlot))
slotNumber                  = 15    # Index of slot where the PRS is loaded
betaPRS                     = 0.5   # power scaling factor of PRS per ofdm symbol

prsGrid   = np.zeros((nBSs, numSlots, 14, numRBs*12), dtype = np.complex64)
prsObject = np.empty((nBSs), dtype=object)
resGrid   = np.zeros((numSlots, 14, 12), dtype = np.int8)
for nbs in range(nBSs):
# Object for generating the PRS Resource Grid
    slotIndex      = int(nbs/numBSsPerSlot)
    prsObject[nbs] = ResourceMapperPRS(betaPRS, dl_PRS_CombSizeN, dl_PRS_ReOffset + int(nbs%numBSsPerSlot),
                                       dl_PRS_ResourceSymbolOffset, dl_PRS_NumSymbols, dl_PRS_SequenceID+nbs)
    # Generate the PRS Resource Grid
    prsGrid[nbs, slotIndex]   = prsObject[nbs](slotNumber+slotIndex, numRBs)

    resGrid[slotIndex] = resGrid[slotIndex] + np.round(np.abs(prsGrid[nbs, slotIndex]))[:,0:12]*(nbs+1)

prsGrid = prsGrid.reshape(nBSs, -1, numRBs*12)
resGrid = resGrid.reshape(-1, 12)
[7]:
f,a = prsObject[0].displayResourceGrid() # Display PRS Resource Grid
../../../_images/api_Tutorials_Tutorial21%2B_E2E_Downlink_TDoA_Based_Positioning_for_millimeter_Wave_5G_Networks_Deployed_in_Indoor_Factory_12_0.png
[8]:
fig, ax = plt.subplots(figsize=(11,5.5))
colors  = ['white', 'red', 'lightcoral', 'gold', 'midnightblue', 'purple','black','darkorange', 'green', 'magenta', 'brown', 'yellow', 'pink']
bounds  = np.arange(1, nBSs+1)
bounds  = np.append([0], bounds)
cmap      = plt.get_cmap('gist_rainbow')
colors    = cmap(np.linspace(0,1,nBSs+1))
colors[0] = 0
option  = "limited"
combSize = dl_PRS_CombSizeN


cmap    = mpl.colors.ListedColormap(colors)
norm    = mpl.colors.BoundaryNorm(bounds, cmap.N)

ax.imshow(np.abs(resGrid.T), interpolation='none', cmap=cmap, norm=norm, aspect = "auto", origin='lower')
ax.set_yticks(np.arange(0.5, 12, 1), minor=True);
ax.set_yticks(np.arange(0, 12, 1), minor=False);
ax.set_xticks(np.arange(0.5, 14*numSlots, 1), minor=True);
ax.set_xticks(np.arange(0, 14*numSlots, 1), minor=False);
ax.tick_params(axis='both',which='minor', grid_linewidth=2, width=0)
ax.tick_params(axis='both',which='major', grid_linewidth=0.5, grid_linestyle = '--')

ax.set_title("PRS Resource Mapping for all gNBs for CombSize= "+str(combSize), fontweight ='bold')
ax.set_xlabel('OFDM symbol-Index, l, in slot number-'+str(slotNumber))
ax.set_ylabel('Subcarrier-Index')

patches = [ mpatches.Patch(color=colors[i], label="BS"+str(i-1)) for i in range(1,nBSs+1) ]
# put those patched as legend-handles into the legend
ax.legend(handles=patches, loc='best', borderaxespad=0. )

plt.grid(which='both')
plt.show()
../../../_images/api_Tutorials_Tutorial21%2B_E2E_Downlink_TDoA_Based_Positioning_for_millimeter_Wave_5G_Networks_Deployed_in_Indoor_Factory_13_0.png

OFDM Transmitter: Create Transmission Grid

  • Transmission Grid: XGrid

  • Bandwidth RE Offset: bwpOffset

[9]:
XGrid     = np.zeros((nBSs, 14*numSlots, Nfft), dtype = np.complex64)
bwpOffset = np.random.randint(Nfft-numRBs*12)

## Load the resource grid to Transmission Grid
XGrid[...,bwpOffset:(bwpOffset+numRBs*12)] = prsGrid


print()
print("*****************************************************")
print("      Size of the Transmission Grid:  "+str(XGrid.shape))
print("         BWP Resoure Element Offset:  "+str(bwpOffset))
print("      Size of the PRS-Resource Grid:  "+str(prsGrid.shape))
print("*****************************************************")
print()

*****************************************************
      Size of the Transmission Grid:  (18, 28, 1024)
         BWP Resoure Element Offset:  0
      Size of the PRS-Resource Grid:  (18, 28, 1020)
*****************************************************

Display Transmission Grid

[10]:
# Plot Resource Grid
#################################################################
bsIndex = 1
fig, ax = plt.subplots(figsize=(11,5.5))
colors  = ['palegreen', 'white', 'lightcoral', 'gold', 'midnightblue', 'purple']
bounds  = [-1, 0, 1, 2, 3, 4, 5]

cmap    = mpl.colors.ListedColormap(colors)
norm    = mpl.colors.BoundaryNorm(bounds, cmap.N)
ax.imshow(np.round(np.abs(XGrid[bsIndex].T)), cmap = cmap, interpolation='none',
          norm=norm, aspect = "auto", origin='lower')
ax.set_yticks(np.arange(0.5, 12*numRBs, 48), minor=False);
# ax.set_yticks(np.arange(0, 12, 1), minor=False);
# ax.set_xticks(np.arange(0.5, 14*numSlots, 1), minor=True);
ax.set_xticks(np.arange(0, 14*numSlots, 1), minor=False);
# ax.tick_params(axis='both',which='minor', grid_linewidth=2, width=0)
ax.tick_params(axis='both',which='major', grid_alpha = 0.75,
               grid_linewidth=0.05, width=0, grid_linestyle = '--')
ax.set_xlabel("OFDM Symbol Index (n)")
ax.set_ylabel("Subcarrier Index (k)")
ax.set_title("Heatmap of Resource Grid for BS-"+str(bsIndex))
ax = plt.gca()
ax.grid(color='c', linestyle='--', linewidth=0.5)
# Gridlines based on minor ticks
plt.show()
../../../_images/api_Tutorials_Tutorial21%2B_E2E_Downlink_TDoA_Based_Positioning_for_millimeter_Wave_5G_Networks_Deployed_in_Indoor_Factory_17_0.png

Transmit Beamforming

  1. Transmit Power, \(P_t\) (dBm)

  2. Inter-Antenna spacing, d (m)

  3. Beamformed Grid, Xf

  4. Beamforming Direction: (0,0)

Note: Beam sweeping using multiple PRS significantly improves the positioning accuracy.

[11]:
#################################################################
# Bemforming angles
# Inter-element spacing in vertical and horizontal
Pt_dBm= 43
Pt    = 10**(0.1*(Pt_dBm-30))
lamda = 3*10**8/carrierFrequency
d     = 0.5/lamda
theta = 0
# Wt    = np.sqrt(Pt/Nt)*np.exp(1j*2*np.pi*d*np.cos(theta)/(lamda*Nt)*np.arange(0,Nt))
# Xf    = Wt.reshape(-1,1,1)*XGrid1

Xf    = np.sqrt(dl_PRS_CombSizeN*Pt/Nt)*XGrid[..., np.newaxis].repeat(Nt, axis = -1)

print(" Beamformed Grid: "+str(Xf.shape))
 Beamformed Grid: (18, 28, 1024, 4)
[12]:
Hf.shape
[12]:
(1, 18, 100, 1024, 16, 4)

Pass the Beamformed Grid Through Wireless Channel

  1. OFDM Channel, Hf: (Number of Symbols (1), Number of BSs, Number of UEs, Nfft, Number of Rx Antennas, Number Tx Antennas)

  2. Transmit Grid, Xf: (Number of BSs, Number of Tx Antennas, Number of Symbols, Nfft)

  3. Received Grid, Y: (Number of UEs, Number of Rx Antennas, Number of Symbols, Nfft)

Note: Static Wireless Channel (No mobility is considered)

[13]:
Y = np.zeros((nUEs, Nr, 14*numSlots, Nfft), dtype=np.complex64)

for lbs in range(nBSs):
    for lue in range(nUEs):
        Y[lue] = Y[lue] + (Hf[0,lbs, lue][:,np.newaxis,...]@Xf[lbs].transpose(1,0,2)[...,np.newaxis])[...,0].transpose(-1,1,0)


print()
print("*****************************************************")
print("          Size of the Channel: "+str(Hf.shape))
print("Size of the Transmited Signal: "+str(Xf.shape))
print("  Size of the Received Signal: "+str(Y.shape))
print("*****************************************************")
print()

*****************************************************
          Size of the Channel: (1, 18, 100, 1024, 16, 4)
Size of the Transmited Signal: (18, 28, 1024, 4)
  Size of the Received Signal: (100, 16, 28, 1024)
*****************************************************

Add Noise

  • Noise Variance: \(k_B\) * T * B where

    • \(k_B\): Boltzmann Constant: \(1.380649 \times 10^{-23}\)

    • T: Temperature: 300 K

    • B: Bandwidth: 30 MHz

  • Carrier Frequency Offset: Not considered in this simulation

    • kppm (CFO in ppm of carrier frequency): 0

    • CFO

  • Received Grid with Noise (Yf)

[14]:
BoltzmanConst = 1.380649*(10**(-23))
temperature   = 300
# noisePower    = BoltzmanConst*temperature*Bandwidth
noisePower    = BoltzmanConst*temperature*scs
kppm          = 0
fCFO          = kppm*(np.random.rand()-0.5)*carrierFrequency*(10**(-6)); # fCFO = CFO*subcarrierSpacing
CFO           = (fCFO/scs)/Nfft
##Yf            = AddNoise(True)(Y, noisePower, CFO)

Yf            = AddNoise(False)(Y, noisePower, 0)    #Added

Extracting the Resource Grid

[15]:
rxGrid = Yf[...,bwpOffset:(bwpOffset+numRBs*12)]
[17]:
bsIndex = 0
ueIndex = 0
antIdx  = 0

# Plot Resource Grid
#################################################################
fig, ax = plt.subplots(figsize=(11,5.5))
# colors  = ['palegreen', 'white', 'lightcoral', 'gold', 'midnightblue', 'purple']
# bounds  = [-1, 0, 1, 2, 3, 4, 5]

cmap    = mpl.colors.ListedColormap(colors)
norm    = mpl.colors.BoundaryNorm(bounds, cmap.N)
plt.imshow(np.abs(rxGrid[0,0].T), cmap = "hot", interpolation='none', aspect = "auto", origin='lower')
ax.axvline(x=13.5, color = 'y', lw = 3)
ax.set_yticks(np.arange(0.5, 12*numRBs, 48), minor=False);
# ax.set_yticks(np.arange(0, 12, 1), minor=False);
# ax.set_xticks(np.arange(0.5, 14*numSlots, 1), minor=True);
ax.set_xticks(np.arange(0, 14*numSlots, 1), minor=False);
# ax.tick_params(axis='both',which='minor', grid_linewidth=2, width=0)
ax.tick_params(axis='both',which='major', grid_alpha = 0.75,
               grid_linewidth=0.05, width=0, grid_linestyle = '--')
ax.set_xlabel("OFDM Symbol Index (n)")
ax.set_ylabel("Subcarrier Index (k)")
ax.set_title("Heatmap of Received Grid for UE-"+str(ueIndex))
ax = plt.gca()
ax.grid(color='c', linestyle='--', linewidth=0.5)
# Gridlines based on minor ticks
plt.show()
../../../_images/api_Tutorials_Tutorial21%2B_E2E_Downlink_TDoA_Based_Positioning_for_millimeter_Wave_5G_Networks_Deployed_in_Indoor_Factory_27_0.png

Channel Estimation + Interpolation

  • Channel estimation using zero-forcing/Least squares

  • Interpolation using spline interpolation from SciPy (splrep, splev)

  • Measurements across time are aggregated to improve the quality of channel estimates.

    • As the channel is no varying accross time.

[18]:
rxGrid  = rxGrid.reshape(nUEs, Nr, numSlots, 14, numRBs*12)
prsGrid = prsGrid.reshape(nBSs, numSlots, 14, numRBs*12)
overSamplingFactor = 1
sA    = 0
sP    = 0
Hfest = np.zeros((nBSs, nUEs, Nr, 14, 12*numRBs), dtype=np.complex64)
Hfint = np.zeros((nBSs, nUEs, Nr, overSamplingFactor*12*numRBs), dtype=np.complex64)

for lbs in range(nBSs):
    slotIndex   = int(lbs/numBSsPerSlot)
    for lue in range(nUEs):
#         print("lbs, lue",lbs, lue)
        for nr in range(Nr):
            Hfest[lbs, lue, nr][prsObject[lbs].prsIndices] = rxGrid[lue, nr, slotIndex][prsObject[lbs].prsIndices]/prsGrid[lbs, slotIndex][prsObject[lbs].prsIndices]
            H   = np.sum(Hfest[lbs, lue, nr], axis = -2)
            tck = interpolate.splrep(np.arange(0, overSamplingFactor*12*numRBs, overSamplingFactor), np.abs(H), s=sA)
            amp = interpolate.splev( np.arange(0, overSamplingFactor*12*numRBs), tck, der=0)
            tck = interpolate.splrep(np.arange(0, overSamplingFactor*12*numRBs, overSamplingFactor), np.unwrap(np.angle(H)), s=sP)
            Hfint[lbs, lue, nr] = amp * np.exp(1j*interpolate.splev(np.arange(0, overSamplingFactor*12*numRBs), tck, der=0))

Display the quality of Channel Estimates

[19]:
bsIndex = 0
ueIndex = 0
antIdx  = 0

fig, ax = plt.subplots(figsize=(11,5.5))

ax.plot(np.arange(bwpOffset, bwpOffset+12*numRBs, overSamplingFactor), np.abs(Hfint[bsIndex, ueIndex, antIdx]), label = "(Estimated + Interpolated) Channel")
ax.plot(np.arange(0, Nfft, 1), np.sqrt(dl_PRS_CombSizeN*Pt/Nt)*np.abs(np.sum(Hf[0,bsIndex, ueIndex][:,antIdx,:], axis= -1)), "r:", label = "Ideal Channel")
ax.legend(loc = 'best')
ax.set_xlabel("Subcarrier Index (k)")
ax.set_ylabel("Magnitude of Channel")
ax.set_title("Frequency Response of the Channel between BS-"+str(bsIndex)+" and UE-"+str(ueIndex))
ax.grid()
plt.show()
../../../_images/api_Tutorials_Tutorial21%2B_E2E_Downlink_TDoA_Based_Positioning_for_millimeter_Wave_5G_Networks_Deployed_in_Indoor_Factory_31_0.png

ToA Estimation

Parameters

Values

ToA Estimation Method

ESPRIT

Number of Path-delays estimated

2 (incremented if ESPRIT doesn’t provide legit delays)

Note:

  • ESPRIT has high time and memory-space complexity

  • But yeild better ToA estimates in comparison to MUSIC and DFT based based methods if sufficent diversity is avaiable across measurements (space diversity in this case).

  • Furthermore, it has very few hyper-parameters required to be passed as input.

[20]:
toaEstimation = ToAEstimation("ESPRIT", Hfint[0, 0].reshape(-1,overSamplingFactor*12*numRBs).T.shape)
ToAe          = np.zeros(Hfint.shape[0:2])

Lpath         = 3
for nbs in range(nBSs):
    for nue in range(nUEs):
#         print("(nbs, nue): ("+str(nbs)+", "+str(nue)+")")
        delayEstimates = np.sort(toaEstimation(Hfint[nbs, nue].reshape(-1,overSamplingFactor*12*numRBs).T,
                                               Lpath,
                                               subCarrierSpacing = scs/overSamplingFactor))
        delayEstimates = delayEstimates[delayEstimates > 0]
        K = Lpath
        while((delayEstimates.size==0) or (delayEstimates[0]<=0 and K < 12)):
            K = K + 1
            delayEstimates = np.sort(toaEstimation(Hfint[nbs, nue].reshape(-1,overSamplingFactor*12*numRBs).T,
                                                   numberOfPath = K,
                                                   subCarrierSpacing = scs/overSamplingFactor))
            delayEstimates = delayEstimates[delayEstimates > 0]
        if(delayEstimates.size == 0):
            ToAe[nbs, nue] = 10**-9
        else:
            ToAe[nbs, nue] = delayEstimates[0]

Visualization: Time of Arrival locus Circles

Display the locus for all the circle with radius \(= 3 \times 10^{8} \times\) ToA. The circle denotes te possible location of UEs. The UE actually lies at the intersection of the circle drawn around the BS correspsonding to ToA-measurement for the specific UE.

[21]:
#################################################################
rxPosition  = simLayoutObj.UELocations
txPosition  = simLayoutObj.BSLocations
rangeEst_2D = np.sqrt(np.abs((ToAe*(3*10**8))**2 - (rxPosition[:,2].reshape(1,-1)-txPosition[:,2].reshape(-1,1))**2))

fig, ax = plt.subplots(figsize=(10,5))
ax.set_aspect(True)
colors  = ["k","m","r","b","g","y","crimson"]

linestyle_tuple = ['solid', 'dotted', 'dashed', 'dashdot',
                   (0, (5, 10)),                # 'loosely dashed'
                   (0, (1, 10)),                # 'loosely dotted'
                   (5, (10, 3)),                # 'long dash with offset'
                   (0, (5, 1)),                 # 'densely dashed'
                   (0, (3, 10, 1, 10)),         # 'loosely dashdotted'
                   (0, (3, 5, 1, 5)),           # 'dashdotted'
                   (0, (3, 1, 1, 1)),           # 'densely dashdotted'
                   (0, (3, 5, 1, 5, 1, 5)),     # 'dashdotdotted'
                   (0, (3, 10, 1, 10, 1, 10)),  # 'loosely dashdotdotted'
                   (0, (3, 1, 1, 1, 1, 1))]     # 'densely dashdotdotted'

for nbs in range(nBSs):
    for nue in range(nUEs):
            circle1 = plt.Circle((txPosition[nbs,0], txPosition[nbs,1]), rangeEst_2D[nbs,nue],
                                 color = colors[nue%7], lw = 0.5, ls = linestyle_tuple[nue%7],
                                 fill = False, zorder = 1)
            ax.add_artist(circle1)

ax.scatter(txPosition[:,0], txPosition[:,1], marker="P", color="b", edgecolors='white', s = 200, label="Tx-Locations", zorder = 2)
ax.legend()
ax.set_xlabel("x-coordinates (m)")
ax.set_ylabel("y-coordinates (m)")
ax.set_title("Transmitter's Locations and ToA Locuses (Potential UE Locations)")
ax.grid(True)
plt.show()
#________________________________________________________________
../../../_images/api_Tutorials_Tutorial21%2B_E2E_Downlink_TDoA_Based_Positioning_for_millimeter_Wave_5G_Networks_Deployed_in_Indoor_Factory_35_0.png

Position Estimation + K-Best Measurement Selection (Genie Aided)

Measurement Selection:

  • Select the most accurate k ToA measnurements for Positioning

  • Even 1 Inaccuracte measurement can compromise the positioning performance.

  • Genie Aided Measurement Selection: Assumes that the accuracy of the each measurment is known somehow.

    • Selects the best ToA-measurements available to each UE from the BSs for estimating the location.

[22]:
# # Selection of k Most Accurate Measurements
# #################################################################

k         = 4  # Select k-best measurements
error     = (np.abs(ToAe-channel.delays[0,0,...,0])/channel.delays[0,0,...,0]) # Compute the ToA error in each measurement
bsIndices = (np.argsort(error,axis=0)[0:k]).T

positionEstimate = LeastSquareTDoA()
# positionEstimate = LeastSquareToA()
# Position Estimation Object:
    # Positioning based on: TDoA
    # Optimization Method: Least Square

rxPositionEstimate = np.zeros((nUEs,2,3))
rxStdEstimate      = np.zeros((nUEs))
kBestIndices       = np.zeros((nUEs, k), dtype = np.int8)

for nue in range(nUEs):
    toa               = ToAe[bsIndices[nue],nue]
    tdoa              = toa[1::] - toa[0]
    rxPositionEstimate[nue], rxStdEstimate[nue] = positionEstimate(txPosition[bsIndices[nue]], tdoa=tdoa)
#     rxPositionEstimate[nue], rxStdEstimate[nue] = positionEstimate(txPosition[bsIndices[nue]], toa)
#     print("nue: "+str(nue)+" | Rx Location Estimate: "+str(rxPositionEstimate[nue,0]))

Visualization of Positioning

  • Show the accurcy of positioning by comparing the actual location against the true location.

Disclaimer: Works well only if the intractive matplotlib is enabled

[23]:

rangeEst_2D = np.sqrt(np.abs((ToAe*(3*10**8))**2 - (rxPosition[:,2].reshape(1,-1)-txPosition[:,2].reshape(-1,1))**2)) # fig, ax = plt.subplots() fig, ax = simLayoutObj.display2DTopology(isEqualAspectRatio = True) colors = ["k","m","r","b","g","y","crimson"] linestyle_tuple = ['solid', 'dotted', 'dashed', 'dashdot', (0, (5, 10)), # 'loosely dashed' (0, (1, 10)), # 'loosely dotted' (5, (10, 3)), # 'long dash with offset' (0, (5, 1)), # 'densely dashed' (0, (3, 10, 1, 10)), # 'loosely dashdotted' (0, (3, 5, 1, 5)), # 'dashdotted' (0, (3, 1, 1, 1)), # 'densely dashdotted' (0, (3, 5, 1, 5, 1, 5)), # 'dashdotdotted' (0, (3, 10, 1, 10, 1, 10)), # 'loosely dashdotdotted' (0, (3, 1, 1, 1, 1, 1))] # 'densely dashdotdotted' # for nbs in range(k): # for nue in range(nUEs): # circle1 = plt.Circle((txPosition[kBestIndices[nue, nbs], 0], txPosition[kBestIndices[nue, nbs], 1]), rangeEst_2D[kBestIndices[nue, nbs], nue], # color = colors[nue%7], lw = 0.35, ls = linestyle_tuple[nue%7], fill = False, zorder = 0) # ax.add_artist(circle1) ax.scatter(txPosition[:,0], txPosition[:,1], marker="P", color="b", edgecolors='white', s = 125, label="Tx-Locations", zorder = 3) ax.scatter(rxPositionEstimate[:,0,0], rxPositionEstimate[:,0,1], marker="o", color="g", s = 75, label="Estimated Rx-Locations", zorder = 1) ax.scatter(rxPosition[:,0], rxPosition[:,1], marker=".", color="r", edgecolors='white', s = 100, label="True Rx-Locations", zorder = 2) ax.legend() ax.set_xlabel("x-coordinates (m)") ax.set_ylabel("y-coordinates (m)") ax.set_title("Transmitter's Locations and Estimation Accuracy (True UE Location vs Estimated UE Locations)") ax.set_xlim([-75, 75]) ax.set_ylim([-30, 30]) ax.grid(True)
../../../_images/api_Tutorials_Tutorial21%2B_E2E_Downlink_TDoA_Based_Positioning_for_millimeter_Wave_5G_Networks_Deployed_in_Indoor_Factory_39_0.png

Performance Analysis of Positioning Error for ToA based method

The perfrormance of the positioning methods is analyzed using:

  1. 50 percentile Position Error in Horizontal and Vertical Direction.

  2. 67 percentile Position Error in Horizontal and Vertical Direction.

  3. 90 percentile Position Error in Horizontal and Vertical Direction.

  4. Fraction of users which are positioned with accuracy better ththan 50 cm.

It can be easily observed that:

Error Percentile

Horizontal Error

Vertical Error

50%ile

8.5 cm

13.5cm

66%ile

16.5cm

20.0cm

90%ile

19.6cm

33.1cm

[24]:
nbins = nUEs
xlimit = 1
ylimit = 1
posError3D = np.linalg.norm(rxPositionEstimate[:, 0]-rxPosition, axis=1)
posError3D = np.where(np.isnan(posError3D), 0, posError3D)
posError2D = np.linalg.norm(rxPositionEstimate[:, 0, 0:2]-rxPosition[:, 0:2], axis=1)

# Horizontal Error
count, bins_count = np.histogram(posError2D, bins = nbins, range = [0, xlimit])
pdf = count/nUEs
cdf = np.cumsum(pdf)

fig, ax = plt.subplots()
ax.plot(bins_count[1:], cdf, label = "2D Positioning Error")


# Vertical Error
count, bins_count = np.histogram(posError3D, bins = nbins, range = [0, xlimit])
pdf = count/nUEs
cdf = np.cumsum(pdf)
ax.plot(bins_count[1:], cdf, label = "Vertical Positioning Error")

ax.set_xticks(np.linspace(0, xlimit, 11))
ax.set_xticks(np.linspace(0, xlimit, 21), minor=True)
ax.set_yticks(np.linspace(0, ylimit, 11))
ax.set_yticks(np.linspace(0, ylimit, 21), minor=True)
ax.set_xlabel("Positioning Error (m)")
ax.set_ylabel("CDF of Positioning Error")
ax.set_title("CDF of Positioning Error")
ax.axhline(y = 0.2, lw = 2, alpha = 1, linestyle = ':', color = "crimson", label = "50%ile Positioning Error line")
ax.axhline(y = 2/3, lw = 2, alpha = 1, linestyle = ':', color = "magenta", label = "66.6%ile Positioning Error line")
ax.axhline(y = 0.9, lw = 2, alpha = 1, linestyle = ':', color = "royalblue", label = "90%ile Positioning Error line")
ax.axvline(x = 0.2, lw = 2, alpha = 1, linestyle = '-', color = "midnightblue", label = "50 cm Positioning Accuracy line")

# Specify different settings for major and minor grids
ax.grid(which = 'minor', alpha = 0.25, linestyle = '--')
ax.grid(which = 'major', alpha = 1)

ax.set_xlim([0,xlimit])
ax.set_ylim([0,1])
ax.legend()
plt.show()


# # Code to save the Database
# idx  = 0
# flag = True
# while(flag):
#     print("flag: "+str(idx)+" | i="+str(idx))
#     filename = "Databases/DLTDoA-"+str([idx])+".npz"
#     if(os.path.exists(filename)):
#         idx  = idx + 1
#     else:
#         np.savez(filename, posError3D = posError3D, posError2D = posError2D,
#                  rxPositionEstimate = rxPositionEstimate, rxPosition = rxPosition,
#                  ToAe = ToAe, txPosition = txPosition, propTerrain = propTerrain,
#                  carrierFrequency = carrierFrequency, scs = scs, Nfft = Nfft,
#                  nBSs = nBSs, nUEs = nUEs, numRBs = numRBs,
#                  bsArrayStructure  = np.array([1,1,2,2,1]),
#                  ueArrayStructure  = np.array([1,1,4,4,1]))
#         flag = False
../../../_images/api_Tutorials_Tutorial21%2B_E2E_Downlink_TDoA_Based_Positioning_for_millimeter_Wave_5G_Networks_Deployed_in_Indoor_Factory_41_0.png
flag: 0 | i=0
flag: 1 | i=1
flag: 2 | i=2
flag: 3 | i=3
flag: 4 | i=4

Performance Analysis: For 2000 UEs

[25]:
filename = "Databases/DLTDoA-"+str([0])+".npz"
ds       = np.load(filename)

posError3D = ds["posError3D"]
posError2D = ds["posError2D"]

for i in range(1,5):

    filename   = "Databases/DLTDoA-"+str([i])+".npz"
    ds         = np.load(filename)

    posError3D = np.concatenate([posError3D, ds["posError3D"]])
    posError2D = np.concatenate([posError2D, ds["posError2D"]])

nbins = posError2D.size
xlimit = 1
ylimit = 1

# Horizontal Error
count, bins_count = np.histogram(posError2D, bins = nbins, range = [0, xlimit])
pdf = count/nbins
cdf = np.cumsum(pdf)

fig, ax = plt.subplots()
ax.plot(bins_count[1:], cdf, label = "2D Positioning Error")



# Vertical Error
count, bins_count = np.histogram(posError3D, bins = nbins, range = [0, xlimit])
pdf = count/nbins
cdf = np.cumsum(pdf)
ax.plot(bins_count[1:], cdf, label = "Vertical Positioning Error")

ax.set_xticks(np.linspace(0, xlimit, 11))
ax.set_xticks(np.linspace(0, xlimit, 21), minor=True)
ax.set_yticks(np.linspace(0, ylimit, 11))
ax.set_yticks(np.linspace(0, ylimit, 21), minor=True)
ax.set_xlabel("Positioning Error (m)")
ax.set_ylabel("CDF of Positioning Error")
ax.set_title("CDF of Positioning Error")
ax.axhline(y = 0.2, lw = 2, alpha = 1, linestyle = ':', color = "crimson", label = "50%ile Positioning Error line")
ax.axhline(y = 2/3, lw = 2, alpha = 1, linestyle = ':', color = "magenta", label = "66.6%ile Positioning Error line")
ax.axhline(y = 0.9, lw = 2, alpha = 1, linestyle = ':', color = "royalblue", label = "90%ile Positioning Error line")
ax.axvline(x = 0.2,lw = 2, alpha = 1, linestyle = '-', color = "midnightblue", label = "50 cm Positioning Accuracy line")

# Specify different settings for major and minor grids
ax.grid(which = 'minor', alpha = 0.25, linestyle = '--')
ax.grid(which = 'major', alpha = 1)

ax.set_xlim([0,xlimit])
ax.set_ylim([0,ylimit])
ax.legend()
plt.show()
../../../_images/api_Tutorials_Tutorial21%2B_E2E_Downlink_TDoA_Based_Positioning_for_millimeter_Wave_5G_Networks_Deployed_in_Indoor_Factory_43_0.png
[ ]:
# fig.savefig("IOO_20m_FR1.svg", transparent=False, format = "svg")
# fig.savefig("IOO_20m_FR1.png", transparent=False, format = "png")

Further Study

The tutorial can be extended further to study the effect of:

  • Subcarrier Spacing (\(\Delta f\))

  • Carrier Frequency (\(f_c\))

  • Bandwidth (\(B\))

  • NLoS Probability (\(p_{LOS}\))

  • Transmitter Power (\(P_t\))

  • Number of Base-stations (\(N_{BS}\))

  • Comb-factor (\(K_{comb}\))

on positioning accuracy. Furthermore, different terrians have different propagation characteristics. These characteristics effect the accuracy of positioning.

Thanks for reading the tutorial!

[ ]:

Previous Next

© Copyright 2022-2024, Gigayasa Wireless Private Limited.

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