GW-H5GSDR Logo
Edition-24a.2

Contents:

  • Course Overview
    • Course deliverables:
  • Pre-requisites
  • Getting Started with the Course
  • Course Contents
    • 1. Introduction to ADALM-Pluto SDR and its application programming interface
    • 2. Analysis of Wireless Channel Spectrum using Software Defined Radios
    • 3. Coarse Downlink Time Synchronization in 5G-Wireless Networks
    • 4. Implementation of OFDM in 5G networks
    • 5. Carrier Frequency Offset Estimation and Correction using PSS in 5G Networks
    • 6. Channel Estimation and Equalization for SSB/PBCH using PBCH-DMRS
    • 7. Implementation of PBCH Chain in 5G Networks
    • 8. PDCCH Implementation and Blind Decoding in 5G Networks
    • 9. Data Communication using PDSCH in 5G Networks
    • 10. MIMO-OFDM Systems in 5G Networks
    • 11. Important System Parameters and their effect on the 5G Networks Performance
  • Codes
    • Introduction to Software Defined Radios (SDRs) and Its Application Programming Interface
      • Import Python libraries
      • System Parameters
      • Set-up the SDR
      • Transmitting the data
      • Receiving the data
    • 2. Analysis of Wireless Channel Spectrum using ADALM-Pluto SDR
      • Wireless Spectrum Analysis based on Fast Fourier Transform techniques
        • 2. Import libraries
        • 2. System Parameters
        • 2. Setup SDRs
        • 2. Transmitter Side
          • 2. Generate Samples for transmission
          • 2. Transmit the samples
        • 2. Receiver Side
          • 2. Signal Acquisition: Receive the samples
        • 2. Spectrum Computation
          • 2. Compute the power spectral density
          • 2. Display the power spectral density
        • 2. Quasi realtime Spectrum Analysis
      • Transmitter-side: Wireless Spectrum Analysis based on Fast Fourier Transform techniques
        • 2.1 Import libraries
        • 2.1 System Parameters
        • 2.1 Setup SDRs
        • 2.1 Transmitter Side
          • 2.1 Generate Samples for transmission
          • 2.1 Transmit the samples
      • Receiver-side:Fast Fourier Transform based Spectrum Analysis
        • 2.2 Import libraries
        • 2.2 System Parameters
        • 2.2 Setup SDRs
        • 2.2 Receiver Side
          • 2.2 Signal Acquisition: Receive the samples
        • 2.2 Spectrum Computation
          • 2.2 Compute the power spectral density
          • 2.2 Display the power spectral density
        • 2.2 Quasi Real-time Spectrum Analysis
    • 3. Coarse Downlink Time/OFDM frame Synchronization in 5G-Wireless Networks
      • Downlink Time/Frame Synchronization using PSS in 5G Networks
        • 3. Import Libraries
          • 3. Import Some Basic Python Libraries
          • 3. Import 5G Libraries
        • 3. Emulation Parameters
        • 3. Generate SSB Parameters
        • Generate PSS
        • Generate SSS
        • Generate PBCH-DMRS
        • Generate PBCH Payload
        • Generate SSB
        • Load SSB into SSB resource Grid
        • 3. Construct Transmission Grid and Generate Time Domain Samples
        • OFDM Modulation
        • 3. SDR-Setup Configurations
        • 3. Transmission: SDR RF Transmitter
        • 3. Reception: SDR RF Receiver
        • 3. Time Synchronization: Based on PSS Correlation
        • 3. Frame Synchronization: Visualization
        • 3. Saving Running frames
      • BS Side Implementation-Downlink Time/Frame Synchronization using PSS in 5G Networks
        • 3.1 Import Libraries
          • 3.1 Import Some Basic Python Libraries
          • 3.1 Import 5G Libraries
        • 3.1 Emulation Parameters
        • 3.1 Generate SSB Parameters
        • 3.1 Construct Transmission Grid and Generate Time Domain Samples
        • 3.1 SDR-Setup Configurations
        • 3.1 Transmission: SDR RF Transmitter
      • UE Side Implementation-Downlink Time/Frame Synchronization using PSS in 5G Networks
        • 3.2 Import Libraries
          • 3.2 Import Some Basic Python Libraries
          • 3.2 Import 5G Libraries
        • 3.2 Emulation Parameters
        • 3.2 SDR-Setup Configurations
        • 3.2 Reception: SDR RF Receiver
        • 3.2 Time Frequency Configurations
        • 3.2 Time Synchronization: Based on PSS Correlation
        • 3.2 Frame Synchronization: Visualization
        • 3.2 Saving Running frames
    • 4. OFDM in 5G Networks
      • OFDM in 5G Networks
        • 4. Import Libraries
          • 4. Import Python and SDR Libraries
          • 4. Import 5G Toolkit Libraries
        • 4. Emulation Parameters
        • 4. Transmitter Implementation
        • 4. Generate the SSB Grid for synchronization
        • 4. PSS, SSS, PBCH, DMRS Generation
        • 4. SSB Generation
        • 4. Generate transmission Grid
        • 4. OFDM Modulation: Transmitted SSB
        • 4. SDR-Setup Configurations
        • 4. Transmission
        • 4. Reception
        • 4. Receive Samples from SDR
        • 4. Time Synchronization: Detection of PSS
        • 4. OFDM Demodulation: Receiver
        • 4. Quasi-realtime reception of OFDM Grid
      • Transmitter side implementation: OFDM in 5G Networks
        • 4.1 Import Libraries
          • 4.1 Import Python and SDR Libraries
          • 4.1 Import 5G Toolkit Libraries
        • 4.1 Emulation Parameters
        • 4.1 Transmitter Implementation
        • 4.1 Generate the SSB Grid for synchronization
        • 4.1 PSS, SSS, PBCH, DMRS Generation
        • 4.1 SSB Generation
        • 4.1 Generate transmission Grid
        • 4.1 OFDM Modulation: Transmitted SSB
        • 4.1 SDR-Setup Configurations
        • 4.1 Transmission
      • Receiver side implementation: OFDM in 5G Networks
        • 4.2 Import Libraries
          • 4.2 Import Python and SDR Libraries
          • 4.2 Import 5G Toolkit Libraries
        • 4.2 Emulation Parameters
        • 4.2 SDR-Setup Configurations
        • 4.2 Reception
        • 4.2 Receive Samples from SDR
        • 4.2 Time Synchronization: Detection of PSS
        • 4.2 OFDM Demodulation: Receiver
        • 4.2 Quasi-realtime reception of OFDM Grid
    • 5. Carrier frequency offset (CFO) Estimation and Correction in 5G networks
      • 5. Carrier frequency offset estimation and correction in 5G networks
        • 5. Import Libraries
          • 5. Import Python and SDR Libraries
        • 5. Toolkit Libraries
        • 5. Simulation Parameters
        • 5. PBCH Payload Generation: MIB + ATI
        • 5. PSS, SSS, PBCH, DMRS Generation
        • 5. Constellation Diagram: Base Station
        • 5. SSB Generation
        • 5. OFDM Implementation: Transmission of SSB
        • 5. SDR Setup
        • 5. Transmission of samples
        • 5. Receiver
          • 5. Receive Samples from SDR
        • 5. Time Synchronization: Coarse Tuning
        • 5. CFO Estimation
        • 5. OFDM Demodulation
        • 5. Extract SSB Grid
        • 5. PBCH Processing
        • 5. Constellation Diagram: User Equipment
        • 5. Error vector magnitude (EVM)
        • 5. Quasi-realtime: CFO Estimation and Reconstruction
      • 5.1 Base-station side: Carrier frequency offset (CFO) estimation and correction in 5G networks
        • 5.1 Import Libraries
          • 5.1 Import Python and SDR Libraries
        • 5.1 Toolkit Libraries
        • 5.1 Simulation Parameters
        • 5.1 PBCH Payload Generation: MIB + ATI
        • 5.1 PSS, SSS, PBCH, DMRS Generation
        • 5.1 Constellation Diagram: Base Station
        • 5.1 SSB Generation
        • 5.1 OFDM Implementation: Transmission of SSB
        • 5.1 SDR Setup
        • 5.1 Transmission of samples
      • 5. UE_Side: Carrier frequency offset (CFO) estimation and correction in 5G networks
        • 5.2 Import Libraries
          • 5.2 Import Python and SDR Libraries
        • 5.2 Toolkit Libraries
        • 5.2 Simulation Parameters
        • 5.2 TimeFrequency Parameters
        • 5.2 SDR Setup
        • 5.2 Receiver
          • 5.2 Receive Samples from SDR
        • 5.2 Time Synchronization: Coarse Tuning
        • 5.2 CFO Estimation
        • 5.2 OFDM Demodulation
        • 5.2 Extract SSB Grid
        • 5.2 PBCH Processing
        • 5.2 Constellation Diagram: User Equipment
        • 5.2 Error vector magnitude (EVM)
        • 5.2 Quasi-realtime: CFO Estimation and Reconstruction
    • 6. Channel Estimation and Equalization for SSB-PBCH using PBCH-DMRS
      • 6. Channel Estimation and Equalization for SSB-PBCH in 5G Networks
        • 6. Import Libraries
          • 6. Import Python and SDR Libraries
          • 6. Import 5G Toolkit Libraries
        • 6. Emulation Parameters
        • 6. PBCH Payload Generation: MIB + ATI
        • 6. PSS, SSS, PBCH, DMRS Generation
        • 6. Constellation Diagram: Base Station
        • 6. SSB Generation
        • 6. OFDM Implementation– Transmission of SSB.
        • 6. SDR Setup
        • 6. Transmission
        • 6. Receive Samples from SDR
        • 6. Time Synchronization: Coarse Tuning
        • 6. CFO Estimation
        • 6. OFDM Demodulation
        • 6. Extract SSB Grid
        • 6. SSS and DMRS Parameter Detection
        • 6. Channel Estimation and PBCH Symbol Equalization
        • 6. PBCH Decoding
        • 6. Constellation Diagram: UE
        • 6. Checking whether CRC is correct
        • 6. Quasi-realtime: CFO Estimation and Reconstruction
      • 6. BS-Side: Channel Estimation and Equalization for SSB-PBCH in 5G Networks
        • 6.1 Import Libraries
          • 6.1 Import Python and SDR Libraries
          • 6.1 Import 5G Toolkit Libraries
        • 6.1 Emulation Parameters
        • 6.1 PBCH Payload Generation: MIB + ATI
        • 6.1 PSS, SSS, PBCH, DMRS Generation
        • 6.1 Constellation Diagram: Base Station
        • 6.1 SSB Generation
        • 6.1 OFDM Implementation– Transmission of SSB.
        • 6.1 SDR Setup
        • 6.1 Transmission
      • 6. UE-Side: Channel Estimation and Equalization for SSB-PBCH in 5G Networks
        • 6.2 Import Libraries
          • 6.2 Import Python and SDR Libraries
          • 6.2 Import 5G Toolkit Libraries
        • 6.2 Emulation Parameters
        • 6.2 Time-frequency Parameter
        • 6.2 SDR Setup
        • 6.2 Receive Samples from SDR
        • 6.2 Time Synchronization: Coarse Tuning
        • 6.2 CFO Estimation
        • 6.2 OFDM Demodulation
        • 6.2 Extract SSB Grid
        • 6.2 SSS and DMRS Parameter Detection
        • 6.2 Channel Estimation and PBCH Symbol Equalization
        • 6.2 PBCH Decoding
        • 6.2 Constellation Diagram: UE
        • 6.2 Checking whether CRC is correct
        • 6.2 Quasi-realtime: CFO Estimation and Reconstruction
    • 7. PBCH and MIB in 5G Networks
      • 7. Physical Broadcast Channel in 5G Networks
        • 7. Import Libraries
          • 7. Import Python and SDR Libraries
          • 7. Import 5G Toolkit Libraries
          • 7. Import PBCH Components
        • 7. Emulation Configurations
        • 7. PBCH Payload Generation: MIB + ATI
        • 7. PSS, SSS, PBCH, DMRS Generation
        • 7. PBCH: Transmitter
        • 7. Constellation Diagram: Base Station
        • 7. SSB Generation
        • 7. OFDM Implementation
        • 7. SDR Setup
        • 7. Transmission
        • 7. Receive Samples from SDR
        • 7. Time Synchronization: Coarse Tuning
        • 7. CFO Estimation
        • 7. OFDM Demodulation
        • 7. Extract SSB Grid
        • 7. PBCH Processing
        • 7. Channel Estimation and PBCH Symbol Equalization
        • 7. PBCH Decoding
        • 7. PBCH Receiver: Components
        • 7. Constellation Diagram: UE
        • 7. Checking whether CRC is correct
        • 7. MIB and ATI Parameters at User Equioment
      • 7. Base-station side: Physical Broadcast Channel in 5G Networks
        • 7.1 Import Libraries
          • 7.1 Import Python and SDR Libraries
          • 7.1 Import 5G Toolkit Libraries
          • 7.1 Import PBCH Components
        • 7.1 Emulation Configurations
        • 7.1 PBCH Payload Generation: MIB + ATI
        • 7.1 PSS, SSS, PBCH, DMRS Generation
        • 7.1 PBCH: Transmitter
        • 7.1 Constellation Diagram: Base Station
        • 7.1 SSB Generation
        • 7.1 OFDM Implementation
        • 7.1 SDR Setup
        • 7.1 Transmission
        • MIB Information: Transmitted
      • 7. User equipment side: Physical Broadcast Channel in 5G Networks
        • 7.2 Import Libraries
          • 7.2 Import Python and SDR Libraries
          • 7.2 Import 5G Toolkit Libraries
          • 7.2 Import PBCH Components
        • 7.2 Emulation Configurations
        • 7.2 Time Frequency Parameters
        • 7.2 SDR Setup
        • 7.2 Receive Samples from SDR
        • 7.2 Time Synchronization: Coarse Tuning
        • 7.2 CFO Estimation
        • 7.2 OFDM Demodulation
        • 7.2 Extract SSB Grid
        • 7.2 PBCH Processing
        • 7.2 Channel Estimation and PBCH Symbol Equalization
        • 7.2 PBCH Decoding
        • 7.2 PBCH Receiver: Components
        • 7.2 Constellation Diagram: UE
        • 7.2 Checking whether CRC is correct
        • 7.2 MIB and ATI Parameters at User Equioment
    • 8. Blind Decoding of Physical Downlink Control Channel in 5G Networks
      • 8. Blind Decoding Of Physical Downlink Control Channel on Plutto-SDR
        • 8. Import Libraries
          • 8. Import Python and SDR Libraries
          • 8. Import 5G Toolkit Libraries
        • 8. Emulation Configurations
        • 8. Transmitter Implementation
        • 8. Generate the SSB Grid for synchronization
        • 8. CORESET and Search Space Set Parameters
        • 8. Display Grids
          • 8. PDCCH Grid
          • 8. SSB Grid
          • 8. SSB, PDCCH Merged Grid
        • 8. Constellation Diagram
        • 8. OFDM Modulation: Tx
        • 8. SDR-Setup Configurations
        • 8. Transmission: SDR RF Transmitter
        • 8. Receiver Implementation
        • 8. Reception: SDR RF Receiver
        • 8. Time Synchronization: Based on PSS Correlation
        • 8. OFDM Demodulation and SSB Extraction
        • 8. SSB Grid: Transmitter and Receiver
        • 8. Spectrum: Transmitted Grid and Received Grid
        • 8. Parameter Estimation for SSB and PBCH
        • 8. Channel Estimation and PBCH Symbol Equalization
        • 8. PBCH Decoding and Constellation
        • 8. Performance Verification
        • 8. Channel Estimation and Equalization of PDCCH
        • 8. Blind Decoding of PDCCH candidates
          • 8. Received Constellation
        • 8. Quasi real time animation
      • 8.1 Base station side: Blind Decoding Of Physical Downlink Control Channel on Plutto-SDR
        • 8.1 Import Libraries
          • 8.1 Import Python and SDR Libraries
          • 8.1 Import 5G Toolkit Libraries
        • 8.1 Emulation Configurations
        • 8.1 Transmitter Implementation
        • 8.1 Generate the SSB Grid for synchronization
          • 8.1 CORESET and Search Space Set Parameters
          • 8.1 Display Grids
        • 8.1 Constellation Diagram
        • 8.1 OFDM Modulation: Tx
        • 8.1 SDR-Setup Configurations
        • 8.1 Transmission: SDR RF Transmitter
      • 8.2 User-Equipment side: Blind Decoding Of Physical Downlink Control Channel on Plutto-SDR
        • 8.2 Import Libraries
          • 8.2 Import Python and SDR Libraries
          • 8.2 Import 5G Toolkit Libraries
        • 8.2 Emulation Configurations
        • 8.2 SDR-Setup Configurations
        • 8.2 Receiver Implementation
        • 8.2 Reception: SDR RF Receiver
        • 8.2 Time-Frequency Parameters
        • 8.2 Time Synchronization: Based on PSS Correlation
        • 8.2 CFO Estimation
        • 8.2 OFDM Demodulation and SSB Extraction
        • 8.2 Spectrum: Received Grid
        • 8.2 Parameter Estimation for SSB and PBCH
        • 8.2 Channel Estimation and PBCH Symbol Equalization
        • 8.2 PBCH Decoding and Constellation
        • 8.2 CORESET and Search Space Parameters
        • 8.2 Channel Estimation and Equalization of PDCCH
        • Blind Decoding
          • Blind Decoding of PDCCH candidates
          • 8.2 Received Constellation
        • 8.2 Quasi-real-time simulation
    • 9. Data Communication in 5G Networks using Physical Downlink Shared Channel
      • 9. Downlink Data Communication in 5G Networks
        • 9. Import Python Libraries
        • 9. 5G Toolkit Libraries
        • 9. Emulation Parameters
        • 9. PDSCH Transmitter Implementation
        • 9. Generate the PDSCH related parameters: Use PDSCH Configurations
        • 9. Generate the PDSCH Resource Grid
        • 9. SSB Transmitter Implementation
        • 9. Generate the SSB Resource Grid
        • 9. SDR-Setup Configurations
        • 9. Transmission: SDR RF Transmitter
        • 9. Receiver Implementation: SSB
        • 9. Reception: SDR RF Receiver
        • 9. Time Synchronization: Based on PSS Correlation
        • 9. PBCH Receiver
        • 9. SSB Grid: Transmitter and Receiver
        • 9. Spectrum: Transmitted Grid and Received Grid
        • 9. PBCH Decoding and Constellation
        • 9. Performance Verification
        • 9. PDSCH Receiver Implementation
          • 9. Extract PDSCH Resource Grid
          • 9. PDSCH Receiver
          • 9. Constellation Diagram
        • 9. Key Performance Indicators
        • Quasi-realtime simulation
      • 9. Base-station side: Downlink Data Communication in 5G Networks
        • 9.1. Import Python Libraries
        • 9.1. 5G Toolkit Libraries
        • 9.1. Emulation Parameters
        • 9.1. PDSCH Transmitter Implementation
        • 9.1. Generate the PDSCH related parameters: Use PDSCH Configurations
        • 9.1. Generate the PDSCH Resource Grid
        • 9.1. SSB Transmitter Implementation
        • 9.1. Generate the SSB Resource Grid
        • 9.1. SDR-Setup Configurations
        • 9.1. Transmission: SDR RF Transmitter
      • 9. UE Side: Downlink Data Communication in 5G Networks
        • 9.2. Import Python Libraries
        • 9.2. 5G Toolkit Libraries
        • 9.2. Emulation Parameters
        • Time-Frequency Parameters
        • 9.2. Generate the PDSCH related parameters: Use PDSCH Configurations
        • 9.2. SDR-Setup Configurations
        • 9.2. Receiver Implementation: SSB
        • 9.2. Reception: SDR RF Receiver
        • 9.2. Time Synchronization: Based on PSS Correlation
        • 9.2. PBCH Receiver
        • 9.2. SSB Grid: Transmitter and Receiver
        • 9.2. Spectrum: Transmitted Grid and Received Grid
        • 9.2. PBCH Decoding and Constellation
        • 9.2. PDSCH Receiver Implementation
          • 9.2. Extract PDSCH Resource Grid
          • 9.2. PDSCH Receiver
          • 9.2. Constellation Diagram
        • 9.2. Key Performance Indicators
        • 9.2. Quasi-realtime simulation
    • 10. MIMO-OFDM in 5G Networks
      • 10. MIMO-OFDM in Spatial Multiplexing Mode in 5G Networks
        • 10. Import Python Libraries
        • 10. 5G Toolkit Libraries
        • 10. Emulation Parameters
        • 10. PDSCH Transmitter Implementation
        • 10. Generate the PDSCH related parameters: Use PDSCH Configurations
        • 10. Generate the PDSCH Resource Grid
        • 10. SSB Transmitter Implementation
        • 10. Generate the SSB Resource Grid
        • 10. Precoding and Beamforming Architecture
        • 10. SDR-Setup Configurations
        • 10. Transmission: SDR RF Transmitter
          • 10. Precoding and Beamforming the OFDM signal
        • 10. Receiver Implementation: SSB
        • 10. Reception: SDR RF Receiver
        • 10. Time Synchronization: Based on PSS Correlation
        • 10. PBCH Receiver
        • 10. SSB Grid: Transmitter and Receiver
        • 10. Spectrum: Transmitted Grid and Received Grid
        • 10. PBCH Decoding and Constellation
        • 10. Performance Verification
        • 10. PDSCH Receiver Implementation
          • 10. Extract PDSCH Resource Grid
          • 10. PDSCH Receiver
          • 10. Constellation Diagram
        • 10. Key Performance Indicators
        • 10. Quasi-realtime simulation: MIMO in Spatial Multiplexing Mode
      • 10 MIMO-OFDM in Spatial Diversity Mode in 5G Networks
        • 10.1 Import Python Libraries
        • 10.1. 5G Toolkit Libraries
        • 10.1. Emulation Parameters
        • 10.1. PDSCH Transmitter Implementation
        • 10.1. Generate the PDSCH related parameters: Use PDSCH Configurations
        • 10.1. Generate the PDSCH Resource Grid
        • 10.1. SSB Transmitter Implementation
        • 10.1. Generate the SSB Resource Grid
        • 10.1 Precoding and Beamforming Architecture
        • 10.1. SDR-Setup Configurations
        • 10.1. Transmission: SDR RF Transmitter
          • 10.1 Precoding and Beamforming the OFDM signal
        • 10.1. Receiver Implementation: SSB
        • 10.1. Reception: SDR RF Receiver
        • 10.1. Time Synchronization: Based on PSS Correlation
        • 10.1. PBCH Receiver
        • 10.1. SSB Grid: Transmitter and Receiver
        • 10.1. Spectrum: Transmitted Grid and Received Grid
        • 10.1. PBCH Decoding and Constellation
        • 10.1. Performance Verification
        • 10.1. PDSCH Receiver Implementation
          • 10.1. Extract PDSCH Resource Grid
          • 10.1. PDSCH Receiver
          • 10.1. Constellation Diagram
        • 10.1. Key Performance Indicators
        • 10.1. Quasi-realtime simulation: MIMO in Spatial Diversity Mode
    • 11. Effect of System Parameters on the Performance of 5G Networks
      • 11.1 Effect of Bandwidth on 5G Networks Performance
        • 11.1. Import Python Libraries
        • 11.1. 5G Toolkit Libraries
        • 11.1. Emulation Parameters
          • 11.1. Initialization
        • 11.1. Time Frequency Parameters
        • 11.1. PDSCH Transmitter Implementation
        • 11.1. Generate the PDSCH related parameters: Use PDSCH Configurations
        • 11.1. Generate the PDSCH Resource Grid
        • 11.1. SSB Transmitter Implementation
        • 11.1. Generate the SSB Resource Grid
        • 11.1.Precoding and Beamforming Architecture
        • 11.1. SDR-Setup Configurations
        • 11.1. Transmission: SDR RF Transmitter
          • 11.1. Precoding and Beamforming the OFDM signal
        • 11.1. Receiver Implementation: SSB
        • 11.1. Reception: SDR RF Receiver
        • 11.1. Time Synchronization: Based on PSS Correlation
        • 11.1. PBCH Receiver
        • 11.1. SSB Grid: Transmitter and Receiver
        • 11.1. Spectrum: Transmitted Grid and Received Grid
        • 11.1. PBCH Decoding and Constellation
        • 11.1. Performance Verification
        • 11.1. PDSCH Receiver Implementation
          • 11.1. Extract PDSCH Resource Grid
          • 11.1. PDSCH Receiver
          • 11.1. Constellation Diagram
        • 11.1. Key Performance Indicators
        • 11.1. Bandwidth vs Network Throughput
      • 11.3 Effect of Modulation Order and Coding Rate (MCS) on 5G Networks Performance
        • 11.3. Import Python Libraries
        • 11.3. 5G Toolkit Libraries
        • 11.3. Emulation Parameters
          • 11.3. Initialization
        • 11.3. Time Frequency Parameters
        • 11.3. PDSCH Transmitter Implementation
        • 11.3. Generate the PDSCH related parameters: Use PDSCH Configurations
        • 11.3. Generate the PDSCH Resource Grid
        • 11.3. SSB Transmitter Implementation
        • 11.3. Generate the SSB Resource Grid
        • 11.3. SDR-Setup Configurations
        • 11.3. Receiver Implementation: SSB
        • 11.3. Reception: SDR RF Receiver
        • 11.3. Time Synchronization: Based on PSS Correlation
        • 11.3. PBCH Receiver
        • 11.3. SSB Grid: Transmitter and Receiver
        • 11.3. Spectrum: Transmitted Grid and Received Grid
        • 11.3. PBCH Decoding and Constellation
        • 11.3. Performance Verification
        • 11.3. PDSCH Receiver Implementation
          • 11.3. Extract PDSCH Resource Grid
          • 11.3. PDSCH Receiver
          • 11.3. Constellation Diagram
        • 11.3. Key Performance Indicators
        • 11.3. MCS Index (\(Q_m, r\)) vs Network Throughput
  • Upcoming versions of this Course
    • Edition-24a.3+ of GW-H5GSDR
    • Edition-24b of GW-H5GSDR
    • Edition-25a of GW-H5GSDR
    • 6G Features
  • Contributors to this course
  • Support Us
    • Cite this course
  • Downloads
  • Report your concerns
  • Back to 5G-Toolkit
GW-H5GSDR
  • Codes
  • 3. Coarse Downlink Time/OFDM frame Synchronization in 5G-Wireless Networks
  • Downlink Time/Frame Synchronization using PSS in 5G Networks

YouTube logo Watch on YouTube View on GitHub Download notebook

Downlink Time/Frame Synchronization using PSS in 5G Networks

Downlink time/frame synchronization using Primary Synchronization Signal (PSS) in 5G networks is a vital procedure for ensuring precise timing alignment between the base station (gNB) and user equipment (UE). Here’s a more accurate breakdown:

  1. Purpose of Synchronization: Synchronization is crucial for coordinating transmission and reception in wireless networks. In the downlink direction, precise synchronization ensures that UEs can correctly receive and decode the transmitted signals from the base station.

  2. Primary Synchronization Signal (PSS): PSS is a specific signal transmitted periodically by the base station. It consists of unique sequences known as primary synchronization sequences, which convey critical information such as cell identity and timing.

  3. UE Synchronization Process: When a UE attempts to connect to a 5G network, it scans for nearby cells and detects PSS signals. By decoding the PSS, the UE identifies the cell’s identity and estimates the timing offset between its internal clock and the base station’s clock.

  4. Frame Synchronization: Alongside time synchronization, frame synchronization ensures that the UE accurately identifies the boundaries of radio frames transmitted by the base station. This synchronization is essential for proper reception and processing of control and data information within each frame.

  5. Accurate Resource Allocation: Precise time/frame synchronization enables efficient resource allocation by the base station. Aligned UEs allow optimal utilization of available resources, enhancing system capacity and throughput.

  6. Benefits and Impact: Accurate downlink synchronization using PSS enhances overall network performance by improving reception quality, facilitating seamless handovers, and enabling efficient resource management. It ensures robust connectivity and enhances the user experience in 5G networks.

In summary, downlink time/frame synchronization using PSS is critical for ensuring reliable and efficient communication in 5G networks, providing precise timing alignment between base stations and user devices for seamless operation and optimal performance.

3. Import Libraries

3. Import Some Basic Python Libraries

[1]:

# from IPython.display import display, HTML # display(HTML("<style>.container { width:90% !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 numpy as np import adi import matplotlib.patches as patches import matplotlib.animation as animation

3. Import 5G 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, ChannelEstimationAndEqualization, DMRSParameterDetection from toolkit5G.Configurations import TimeFrequency5GParameters, GenerateValidSSBParameters

3. Emulation Parameters

[3]:
# System Parameters
center_frequency    = 1e9     # Carrier frequency for signal transmission

# OFDM Parameters
Bandwidth           = 5*10**6 # bandwidth
fftSize             = 1024    # FFT-size for OFDM
subcarrier_spacing  = 15000   # Subcarrier spacing
numOFDMSymbols      = 14      # Number of OFDM symbols considered for emulation | 1 slot
sample_rate         = fftSize*subcarrier_spacing # sample rate required by OFDM and DAC/ADC of SDR

# Pulse Shaping
numSamplesPerSymbol = 1


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

3. Generate SSB Parameters

[4]:

# This class fetches valid set of 5G parameters for the system configurations nSymbolFrame= int(140*subcarrier_spacing/15000) # This class fetches valid set of 5G parameters for the system configurations tfParams = TimeFrequency5GParameters(Bandwidth, subcarrier_spacing) tfParams(nSymbolFrame, typeCP = "normal") nRB = tfParams.numRBs # SSB Grid size (Number of RBs considered for SSB transmission) Neff = tfParams.Neff # Number of resource blocks for Resource Grid ( exclude gaurd band | offsets : BWP) Nfft = 512 # FFT-size for OFDM lengthCP = tfParams.lengthCP # CP length #___________________________________________________________________ # Generate master information block (MIB) and Addition Time Information (ATI) lamda = 3e8/center_frequency; nSCSOffset = 1 ssbParameters = GenerateValidSSBParameters(center_frequency, nSCSOffset, "caseA") systemFrameNumber = ssbParameters.systemFrameNumber subCarrierSpacingCommon = subcarrier_spacing 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 #_______________________________________

Generate PSS

[5]:
# Generate cell-ID 2 for PSS generation and cell-ID computation
N_ID2        = np.random.randint(3)

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

Generate SSS

[6]:
# Generate cell-ID 1 for SSS generation and cell-ID computation
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 PBCH-DMRS

[7]:

# Generate DMRS sequence dmrsLen = 144; dmrsObject = DMRS("PBCH", N_ID, ssbIndex, nssbCandidatesInHrf, hrfBit) dmrsSequence = dmrsObject(dmrsLen)

Generate PBCH Payload

[8]:

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

Generate SSB

[9]:

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

Load SSB into SSB resource Grid

[10]:

# 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 = center_frequency, isPairedBand = isPairedBand, withSharedSpectrumChannelAccess = withSharedSpectrumChannelAccess) ssbGrid = ssbRGobject(ssb[0], ssbPositionInBurst, offsetInSubcarriers = ssbSubCarrierOffset[0], offsetInRBs = 0, numRBs = nRB)[0:14] fig, ax = ssbObject.displayGrid(option=1)
../../../../_images/api_Content_Codes_Tutorial-3%5BCoarse_Time_Synchronization_using_PSS_in_5G_Networks%5D_DL_Time%28Frame%29_Synchronization_using_PSS_in_5G_19_0.png

3. Construct Transmission Grid and Generate Time Domain Samples

[11]:


## Loading SSB to Resource Grid numofGuardCarriers = (int((fftSize - Neff)/2), int((fftSize - Neff)/2)) offsetToPointA = 0 firstSCIndex = int(numofGuardCarriers[0] + offsetToPointA) numOFDMSymbols = ssbGrid.shape[0] # The transmission grid that will carry SSB and will be OFDM modulated X = np.zeros((numOFDMSymbols, fftSize), dtype= np.complex64) X[:, firstSCIndex:firstSCIndex+ssbGrid.shape[-1]] = ssbGrid # Plot Resource Grid ################################################################# fig, ax = plt.subplots() plt.imshow(np.abs(X), 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_Content_Codes_Tutorial-3%5BCoarse_Time_Synchronization_using_PSS_in_5G_Networks%5D_DL_Time%28Frame%29_Synchronization_using_PSS_in_5G_21_0.png

OFDM Modulation

[12]:

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

3. SDR-Setup Configurations

[13]:

# SDR setup sdr = adi.Pluto("ip:192.168.2.1") # Create object of SDR setup object and configure the IP of SDR connect to the system sdr.sample_rate = int(sample_rate) # Sets the sample rate for the ADC/DAC of the SDR. # Config Tx sdr.tx_rf_bandwidth = int(sample_rate) # Set the bandwidth of the transmit filter | Can be set same as the sample rate # For Pluto SDR, tx_rf_bandwidth should be between 200 kHz and 56 MHz. sdr.tx_lo = int(center_frequency) # Sets the transmitter local oscillator frequency. The carrier is used to modulate/up-convert the analog information signal. # For Pluto SDR, tx_lo can take a value between 325 MHz to 3.8 GHz. sdr.tx_hardwaregain_chan0 = 0 # Sets the gain (dB) of the transmitter power amplifier. The higher the value the more the power radiated by antenna. # For Pluto SDR, tx_hardwaregain_chan0 can take values between -90 to 0. # Config Rx sdr.rx_lo = int(center_frequency) # Sets the receiver local oscillator frequency. # For Pluto SDR, rx_lo can take a value between 325 MHz to 3.8 GHz. sdr.rx_rf_bandwidth = int(60*10**6) # Set the bandwidth (in Hz) of the reception filter # For Pluto SDR, tx_rf_bandwidth should be between 200 kHz and 56 MHz. sdr.rx_buffer_size = int(buffer_size) # Number of samples to read and load into SDR buffer. # The upper limit on the size of this buffer is defined by the DRAM size. sdr.gain_control_mode_chan0 = 'manual' # Defines the mode of receiver AGC. # # AGC modes: # # 1. "manual" # # 2. "slow_attack" # # 3. "fast_attack" # The receive gain on the Pluto has a range from 0 to 74.5 dB. sdr.rx_hardwaregain_chan0 = 40.0 # dB, increase to increase the receive gain, but be careful not to saturate the ADC # Sets the amplification gain (dB) provided by the low noise amplifier (LNA). # Relevant only when `gain_control_mode_chan0` is "manual".

3. Transmission: SDR RF Transmitter

[14]:

# Start the transmitter sdr.tx_cyclic_buffer = True # Enable cyclic buffers sdr.tx(1.3*2**17*(x_time.repeat(1))) # start transmitting

3. Reception: SDR RF Receiver

[15]:

# 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()

3. Time Synchronization: Based on PSS Correlation

[16]:
## PSS Detection: Based on time domain PSS Correlation

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

# pssPeakIndices: indicates the time/sample indices where time correlation has spikes
    # 1. Spikes are computed based on the Input parameters related to peak detector

# pssCorrelation: Returns the correlation plot for the selected cell-ID 2.
# rN_ID2: Detected Cell ID2 by the algorithm
# freqOffset: frequency offset where SSB/PSS was detected.


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

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) (379, 0)
**(rasterOffset, PSS-ID) (379, 1)
**(rasterOffset, PSS-ID) (379, 2)
../../../../_images/api_Content_Codes_Tutorial-3%5BCoarse_Time_Synchronization_using_PSS_in_5G_Networks%5D_DL_Time%28Frame%29_Synchronization_using_PSS_in_5G_31_1.png

3. Frame Synchronization: Visualization

Note: The following snippet of code only works with interactive maplotlib.

  1. caution1-3 Please ensure that you have intractive matplotlib installed on your system.

  2. uncomment the ``%matplotlib widget`` in first code block for the following section of code to work

[17]:
correlation    = np.zeros((3, pssCorrelation.size), dtype = np.float32)
r              = rx_samples[i:i+fftSize]
correlation[0] = np.abs(np.correlate(rx_samples, np.squeeze(pssDetection.pssRTime[0]), mode='valid'))
correlation[1] = np.abs(np.correlate(rx_samples, np.squeeze(pssDetection.pssRTime[1]), mode='valid'))
correlation[2] = np.abs(np.correlate(rx_samples, np.squeeze(pssDetection.pssRTime[2]), mode='valid'))

# function that draws each frame of the animation
def animate(i):

    ax[0].clear()
    ax[0].grid()
    ax[0].plot(correlation[0,0:scale*(i+1)], color='k', label = "Correlation With PSS with $n_{ID}^{2}=0$")
    ax[0].legend()
    ax[0].set_xlim([0,pssCorrelation.size])
    ax[0].set_ylim([0,np.max(pssCorrelation)*1.1])

    ax[1].clear()
    ax[1].grid()
    ax[1].plot(correlation[1,0:scale*(i+1)], color='g', label = "Correlation With PSS with $n_{ID}^{2}=1$")
    ax[1].legend()
    ax[1].set_xlim([0,pssCorrelation.size])
    ax[1].set_ylim([0,np.max(pssCorrelation)*1.1])

    ax[2].clear()
    ax[2].grid()
    ax[2].plot(correlation[2,0:scale*(i+1)], color='b', label = "Correlation With PSS with $n_{ID}^{2}=2$")
    ax[2].legend()
    ax[2].set_xlim([0,pssCorrelation.size])
    ax[2].set_ylim([0,np.max(pssCorrelation)*1.1])

    ax[3].clear()
    ax[3].grid()
    ax[3].plot(np.real(rx_samples[0:scale*(i+1)]), color='r', label = "real part of received signal")
    ax[3].plot(np.imag(rx_samples[0:scale*(i+1)]), color='y', label = "imaginary part of received signal")
    ax[3].legend()
    ax[3].set_xlim([0,pssCorrelation.size])
    ax[3].set_ylim([minX,maxY])

minX = np.min([np.real(rx_samples).min(), np.imag(rx_samples).min()])
maxY = np.max([np.real(rx_samples).max(), np.imag(rx_samples).max()])
# create the figure and axes objects
scaleFig = 1.75
fig, ax  = plt.subplots(4,1,figsize=(30/scaleFig, 20/scaleFig))
fig.suptitle('Spectrum of the Received Signal', fontsize=10)

scale = 100
#####################
# run the animation
#####################
# frames= 20 means 20 times the animation function is called.
# interval=500 means 500 milliseconds between each frame.
# repeat=False means that after all the frames are drawn, the animation will not repeat.
# Note: plt.show() line is always called after the FuncAnimation line.


anim = animation.FuncAnimation(fig, animate, frames=int(np.floor((correlation.size-1)/scale)), interval=1, repeat=False, blit=True)
# saving to mp4 using ffmpeg writer
plt.show()

# anim.save("Overall.gif", fps = 10)

# writervideo = animation.FFMpegWriter(fps=60)
# anim.save('Overall.mp4', writer=writervideo)
Overall-3

3. Saving Running frames

Note: The following snippet of code only works with interactive maplotlib.

  1. caution2-3 Please ensure that you have intractive matplotlib installed on your system.

  2. uncomment the ``%matplotlib widget`` in first code block for the following section of code to work

[18]:

# function that draws each frame of the animation def animate(i): if scale*i+fftSize < rx_samples.size: ax1[3].clear() ax1[3].grid() ax1[3].plot(np.arange(scale*i,(scale*i+fftSize)), np.real(rx_samples[scale*i:(scale*i+fftSize)]), color='r', label = "real part of received signal") ax1[3].plot(np.arange(scale*i,(scale*i+fftSize)), np.imag(rx_samples[scale*i:(scale*i+fftSize)]), color='y', label = "imaginary part of received signal") ax1[3].legend() ax1[3].set_xlim([scale*i, scale*i+fftSize]) ax1[3].set_ylim([minX,maxY]) # create the fig1ure and axes objects scalefig1 = 1.75 fig1, ax1 = plt.subplots(4,1,figsize=(30/scalefig1, 20/scalefig1)) fig1.suptitle('Spectrum of the Received Signal', fontsize=10) minX = np.min([np.real(pssDetection.pssRTime[0]).min(), np.imag(pssDetection.pssRTime[0]).min()]) maxY = np.max([np.real(pssDetection.pssRTime[0]).max(), np.imag(pssDetection.pssRTime[0]).max()]) ax1[0].plot(np.real(pssDetection.pssRTime[0]), color='k', label = "real part of Time domain PSS with $n_{ID}^{2}=0$") ax1[0].plot(np.imag(pssDetection.pssRTime[0]), color='r', label = "imaginary part of Time domain PSS with $n_{ID}^{2}=0$") ax1[0].legend() ax1[0].set_xlim([0,pssDetection.pssRTime[2].size]) ax1[0].set_ylim([minX,maxY]) minX = np.min([np.real(pssDetection.pssRTime[1]).min(), np.imag(pssDetection.pssRTime[1]).min()]) maxY = np.max([np.real(pssDetection.pssRTime[1]).max(), np.imag(pssDetection.pssRTime[1]).max()]) ax1[1].plot(np.real(pssDetection.pssRTime[1]), color='k', label = "real part of Time domain PSS with $n_{ID}^{2}=1$") ax1[1].plot(np.imag(pssDetection.pssRTime[1]), color='r', label = "imaginary part of Time domain PSS with $n_{ID}^{2}=1$") ax1[1].legend() ax1[1].set_xlim([0,pssDetection.pssRTime[2].size]) ax1[1].set_ylim([minX,maxY]) minX = np.min([np.real(pssDetection.pssRTime[2]).min(), np.imag(pssDetection.pssRTime[2]).min()]) max1Y = np.max([np.real(pssDetection.pssRTime[2]).max(), np.imag(pssDetection.pssRTime[2]).max()]) ax1[2].plot(np.real(pssDetection.pssRTime[2]), color='k', label = "real part of Time domain PSS with $n_{ID}^{2}=2$") ax1[2].plot(np.imag(pssDetection.pssRTime[2]), color='r', label = "imaginary part of Time domain PSS with $n_{ID}^{2}=2$") ax1[2].legend() ax1[2].set_xlim([0,pssDetection.pssRTime[2].size]) ax1[2].set_ylim([minX,maxY]) # fig1.clear() minX = np.min([np.real(rx_samples).min(), np.imag(rx_samples).min()]) maxY = np.max([np.real(rx_samples).max(), np.imag(rx_samples).max()]) scale = 100 ##################### # run the animation ##################### # frames= 20 means 20 times the animation function is called. # interval=500 means 500 milliseconds between each frame. # repeat=False means that after all the frames are drawn, the animation will not repeat. # Note: plt.show() line is always called after the FuncAnimation line. anim1 = animation.FuncAnimation(fig1, animate, frames=int(np.floor((rx_samples.size-1)/scale)-1), interval=1, repeat=False, blit=True) # saving to mp4 using ffmpeg writer plt.show() # anim1.save("Overall_frame.gif", fps = 10) # writervideo = animation.FFMpegWriter(fps=60) # anim1.save('Overall_frame.mp4', writer=writervideo)
Overall_frame-3
[ ]:

Previous Next

© Copyright 2024-2026, Gigayasa Wireless Private Limited.

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