# arasgungore/pcm-and-dm-modulators architecture

> Architecture diagram of the GitHub repository arasgungore/pcm-and-dm-modulators, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arasgungore/pcm-and-dm-modulators
- Repository: https://github.com/arasgungore/pcm-and-dm-modulators

## Overview

##### Project type and purpose
- This is a small academic signal-processing tool (open-source library) that implements two modulation schemes—pulse-code modulation (PCM) and delta modulation (DM)—in both Python (Jupyter notebook) and MATLAB.
- Its purpose is to generate a test message signal, sample it, quantize or delta-encode it, and display the resulting binary sequences and plots.

##### File structure
- Top level
- Figures/      ← stored output plots (JPEGs) for Python and MATLAB DM
- main.ipynb    ← Python notebook with code for PCM and DM
- main.m        ← MATLAB script that runs both tasks
- project_desc.pdf ← original project specification
- README.md, LICENSE
- No “build” or “deploy” scripts—this is a research/teaching tool run interactively or via MATLAB CLI.

##### README for additional insights
- Describes two tasks: PCM at Nyquist rate with 128 levels, DM at 4× Nyquist rate.
- Shows how to run the MATLAB script headless.
- Indicates that the user should print the first few binary outputs and generate figures.

##### Essential elements
- Do not overcomplicate—this is a single-machine, single-process pipeline.
- Every algorithmic stage as its own block.
- Clearly that both implementations consume the same generated signal and produce analogous outputs.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Python Implementation"
        NB["Jupyter Notebook"]:::python
        NB --> SG_PY["Input Signal Generator\nm(t)=–cos(200πt)+sin(50πt)"]:::process
        SG_PY --> Samp_PY["Sampling Block\nNyquist & 4×Nyquist"]:::process
        Samp_PY --> Q_PY["Quantizer (PCM)\nUniform L=128"]:::pcm
        Q_PY --> BE_PY["Binary Encoder"]:::pcm
        BE_PY --> VIZ_PY["Output & Visualization"]:::pcm
        Samp_PY --> DE_PY["Delta Encoder (DM)\nStep & Comparator"]:::dm
        DE_PY --> BE2_PY["Binary Encoder"]:::dm
        BE2_PY --> VIZ2_PY["Output & Visualization"]:::dm
    end

    subgraph "MATLAB Implementation"
        MCL["MATLAB Script (CLI)"]:::matlab
        MCL --> SG_MAT["Input Signal Generator\nm(t)=–cos(200πt)+sin(50πt)"]:::process
        SG_MAT --> Samp_MAT["Sampling Block\nNyquist & 4×Nyquist"]:::process
        Samp_MAT --> Q_MAT["Quantizer (PCM)\nUniform L=128"]:::pcm
        Q_MAT --> BE_MAT["Binary Encoder"]:::pcm
        BE_MAT --> VIZ3_MAT["Output & Visualization"]:::pcm
        Samp_MAT --> DE_MAT["Delta Encoder (DM)\nStep & Comparator"]:::dm
        DE_MAT --> BE2_MAT2["Binary Encoder"]:::dm
        BE2_MAT2 --> VIZ4_MAT["Output & Visualization"]:::dm
    end

    VIZ_PY --> Figures["Figures/ (JPEG outputs)"]:::data
    VIZ2_PY --> Figures
    VIZ3_MAT --> Figures
    VIZ4_MAT --> Figures

    NB --> Docs["Documentation\nproject_desc.pdf\nREADME.md\nLICENSE"]:::doc
    MCL --> Docs

    click SG_PY "https://github.com/arasgungore/pcm-and-dm-modulators/blob/main/main.ipynb"
    click Samp_PY "https://github.com/arasgungore/pcm-and-dm-modulators/blob/main/main.ipynb"
    click Q_PY "https://github.com/arasgungore/pcm-and-dm-modulators/blob/main/main.ipynb"
    click DE_PY "https://github.com/arasgungore/pcm-and-dm-modulators/blob/main/main.ipynb"
    click BE_PY "https://github.com/arasgungore/pcm-and-dm-modulators/blob/main/main.ipynb"
    click BE2_PY "https://github.com/arasgungore/pcm-and-dm-modulators/blob/main/main.ipynb"
    click NB "https://github.com/arasgungore/pcm-and-dm-modulators/blob/main/main.ipynb"

    click SG_MAT "https://github.com/arasgungore/pcm-and-dm-modulators/blob/main/main.m"
    click Samp_MAT "https://github.com/arasgungore/pcm-and-dm-modulators/blob/main/main.m"
    click Q_MAT "https://github.com/arasgungore/pcm-and-dm-modulators/blob/main/main.m"
    click DE_MAT "https://github.com/arasgungore/pcm-and-dm-modulators/blob/main/main.m"
    click BE_MAT "https://github.com/arasgungore/pcm-and-dm-modulators/blob/main/main.m"
    click BE2_PY "https://github.com/arasgungore/pcm-and-dm-modulators/blob/main/main.m"
    click MCL "https://github.com/arasgungore/pcm-and-dm-modulators/blob/main/main.m"

    click Figures "https://github.com/arasgungore/pcm-and-dm-modulators/tree/main/Figures/"

    classDef python fill:#ffebcd,stroke:#333,stroke-width:1px;
    classDef matlab fill:#e0ffff,stroke:#333,stroke-width:1px;
    classDef pcm fill:#c6efaa,stroke:#333,stroke-width:1px;
    classDef dm fill:#f9d5e5,stroke:#333,stroke-width:1px;
    classDef data fill:#ffd3b6,stroke:#333,stroke-width:1px;
    classDef doc fill:#d3d3d3,stroke:#333,stroke-width:1px;
    class SG_PY,Samp_PY,SG_MAT,Samp_MAT process
```
