# gc1905/5g-nr-pusch architecture

> Architecture diagram of the GitHub repository gc1905/5g-nr-pusch, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gc1905/5g-nr-pusch
- Repository: https://github.com/gc1905/5g-nr-pusch

## Overview

This repository is a MATLAB prototype of a 5G NR PUSCH software transceiver and link-level simulator. The documented user workflow configures and launches a simulation sweep, which runs the link-level processing loop; the transceiver turns transport data into a PUSCH waveform, models a channel, and recovers data at the receiver. A separate entry point runs LDPC codec simulations without baseband processing. The README establishes the entry points and simulation loop; most internal connections below are dashed because the MATLAB sources were not sampled.

Main entry points: [`nr_common/nr_sch_link_level_sim.m`](https://github.com/gc1905/5g-nr-pusch/blob/master/nr_common/nr_sch_link_level_sim.m) (Link-level loop), [`nr_phy/nr_pusch_transmit.m`](https://github.com/gc1905/5g-nr-pusch/blob/master/nr_phy/nr_pusch_transmit.m) (PUSCH transmitter), [`nr_phy/nr_pusch_receive.m`](https://github.com/gc1905/5g-nr-pusch/blob/master/nr_phy/nr_pusch_receive.m) (PUSCH receiver), [`nr_codec`](https://github.com/gc1905/5g-nr-pusch/tree/master/nr_codec) (Transport coding)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_simulation["Simulation"]
  node_sweep["Simulation sweep"]
  node_link_sim["Link-level loop"]
  node_codec_run["Codec simulation<br/>[run_5gnr_codec.m]"]
  node_metrics["Link metrics<br/>[evm.m]"]
end

subgraph group_transmit["Transmit chain"]
  node_transport["Transport coding"]
  node_scrambling["Scrambling and DMRS"]
  node_modulation["Modulation mapping"]
  node_pusch_tx["PUSCH transmitter"]
  node_ofdma_tx["OFDM modulation"]
end

subgraph group_channel["Channel and estimation"]
  node_channel_model["Fading and impairments"]
  node_estimation["Channel and sync estimation"]
end

subgraph group_receive["Receive chain"]
  node_ofdma_rx["OFDM demodulation"]
  node_pusch_rx["PUSCH receiver<br/>[nr_pusch_receive.m]"]
  node_demodulation["Soft demapping"]
  node_decoding["Transport decoding<br/>[nr_sch_decode.m]"]
end

node_user(("Engineer"))

node_user -->|"configures"| node_sweep
node_sweep -->|"runs"| node_link_sim
node_user -->|"runs"| node_codec_run
node_link_sim -.->|"dispatches"| node_pusch_tx
node_link_sim -.->|"applies"| node_channel_model
node_link_sim -.->|"dispatches"| node_pusch_rx
node_link_sim -.->|"measures"| node_metrics
node_link_sim -.->|"configures"| node_transport
node_pusch_tx -.->|"encodes"| node_transport
node_pusch_tx -.->|"uses"| node_scrambling
node_pusch_tx -.->|"maps"| node_modulation
node_pusch_tx -.->|"modulates"| node_ofdma_tx
node_channel_model -.->|"affects"| node_estimation
node_pusch_rx -.->|"demodulates"| node_ofdma_rx
node_pusch_rx -.->|"uses"| node_estimation
node_pusch_rx -.->|"demaps"| node_demodulation
node_pusch_rx -.->|"decodes"| node_decoding
node_codec_run -.->|"simulates"| node_transport

click node_sweep "https://github.com/gc1905/5g-nr-pusch/blob/master/run_5gnr_sim_sweep.m"
click node_link_sim "https://github.com/gc1905/5g-nr-pusch/blob/master/nr_common/nr_sch_link_level_sim.m"
click node_codec_run "https://github.com/gc1905/5g-nr-pusch/blob/master/run_5gnr_codec.m"
click node_transport "https://github.com/gc1905/5g-nr-pusch/tree/master/nr_codec"
click node_scrambling "https://github.com/gc1905/5g-nr-pusch/tree/master/nr_phy"
click node_modulation "https://github.com/gc1905/5g-nr-pusch/blob/master/modulation/modulation_mapper.m"
click node_pusch_tx "https://github.com/gc1905/5g-nr-pusch/blob/master/nr_phy/nr_pusch_transmit.m"
click node_ofdma_tx "https://github.com/gc1905/5g-nr-pusch/blob/master/nr_phy/nr_ofdma_modulator.m"
click node_channel_model "https://github.com/gc1905/5g-nr-pusch/tree/master/fading"
click node_estimation "https://github.com/gc1905/5g-nr-pusch/tree/master/estimation"
click node_ofdma_rx "https://github.com/gc1905/5g-nr-pusch/blob/master/nr_phy/nr_ofdma_demodulator.m"
click node_pusch_rx "https://github.com/gc1905/5g-nr-pusch/blob/master/nr_phy/nr_pusch_receive.m"
click node_demodulation "https://github.com/gc1905/5g-nr-pusch/blob/master/modulation/modulation_demapper_soft.m"
click node_decoding "https://github.com/gc1905/5g-nr-pusch/blob/master/nr_codec/nr_sch_decode.m"
click node_metrics "https://github.com/gc1905/5g-nr-pusch/blob/master/utils/evm.m"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_sweep,node_link_sim,node_codec_run,node_metrics toneBlue
class node_transport,node_scrambling,node_modulation,node_pusch_tx,node_ofdma_tx toneAmber
class node_channel_model,node_estimation toneMint
class node_ofdma_rx,node_pusch_rx,node_demodulation,node_decoding toneRose
class node_user toneIndigo
```

## Components

### Simulation

- [Simulation sweep](https://github.com/gc1905/5g-nr-pusch/blob/master/run_5gnr_sim_sweep.m): `run_5gnr_sim_sweep.m`
- [Link-level loop](https://github.com/gc1905/5g-nr-pusch/blob/master/nr_common/nr_sch_link_level_sim.m): `nr_common/nr_sch_link_level_sim.m`
- [Codec simulation](https://github.com/gc1905/5g-nr-pusch/blob/master/run_5gnr_codec.m): `run_5gnr_codec.m`
- [Link metrics](https://github.com/gc1905/5g-nr-pusch/blob/master/utils/evm.m): `utils/evm.m`

### Transmit chain

- [Transport coding](https://github.com/gc1905/5g-nr-pusch/tree/master/nr_codec): `nr_codec`
- [Scrambling and DMRS](https://github.com/gc1905/5g-nr-pusch/tree/master/nr_phy): `nr_phy`
- [Modulation mapping](https://github.com/gc1905/5g-nr-pusch/blob/master/modulation/modulation_mapper.m): `modulation/modulation_mapper.m`
- [PUSCH transmitter](https://github.com/gc1905/5g-nr-pusch/blob/master/nr_phy/nr_pusch_transmit.m): `nr_phy/nr_pusch_transmit.m`
- [OFDM modulation](https://github.com/gc1905/5g-nr-pusch/blob/master/nr_phy/nr_ofdma_modulator.m): `nr_phy/nr_ofdma_modulator.m`

### Channel and estimation

- [Fading and impairments](https://github.com/gc1905/5g-nr-pusch/tree/master/fading): `fading`
- [Channel and sync estimation](https://github.com/gc1905/5g-nr-pusch/tree/master/estimation): `estimation`

### Receive chain

- [OFDM demodulation](https://github.com/gc1905/5g-nr-pusch/blob/master/nr_phy/nr_ofdma_demodulator.m): `nr_phy/nr_ofdma_demodulator.m`
- [PUSCH receiver](https://github.com/gc1905/5g-nr-pusch/blob/master/nr_phy/nr_pusch_receive.m): `nr_phy/nr_pusch_receive.m`
- [Soft demapping](https://github.com/gc1905/5g-nr-pusch/blob/master/modulation/modulation_demapper_soft.m): `modulation/modulation_demapper_soft.m`
- [Transport decoding](https://github.com/gc1905/5g-nr-pusch/blob/master/nr_codec/nr_sch_decode.m): `nr_codec/nr_sch_decode.m`

### Other components

- **Engineer**

## Connections

- Engineer → Simulation sweep: configures (evidence: `README.md`)
- Simulation sweep → Link-level loop: runs (evidence: `README.md`)
- Engineer → Codec simulation: runs (evidence: `README.md`)
- Link-level loop → PUSCH transmitter: dispatches
- Link-level loop → Fading and impairments: applies
- Link-level loop → PUSCH receiver: dispatches
- Link-level loop → Link metrics: measures
- Link-level loop → Transport coding: configures
- PUSCH transmitter → Transport coding: encodes
- PUSCH transmitter → Scrambling and DMRS: uses
- PUSCH transmitter → Modulation mapping: maps
- PUSCH transmitter → OFDM modulation: modulates
- Fading and impairments → Channel and sync estimation: affects
- PUSCH receiver → OFDM demodulation: demodulates
- PUSCH receiver → Channel and sync estimation: uses
- PUSCH receiver → Soft demapping: demaps
- PUSCH receiver → Transport decoding: decodes
- Codec simulation → Transport coding: simulates
