# sanskar777/qrs-peak-detection-in-ecg-signals-using-verilog architecture

> Architecture diagram of the GitHub repository sanskar777/qrs-peak-detection-in-ecg-signals-using-verilog, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sanskar777/qrs-peak-detection-in-ecg-signals-using-verilog
- Repository: https://github.com/sanskar777/qrs-peak-detection-in-ecg-signals-using-verilog

## Overview

##### Project type and purpose
- This is a hardware-design project written in Verilog.
- Purpose: take a stream of ECG samples, apply a Curve Length Transform (CLT) to detect QRS peaks, and output both peak values and their sample indices.

##### File structure
- CLT.v      → the top-level Verilog module implementing the CLT logic and peak-detection.
- test_clt.v → the Verilog testbench that feeds 500 real ECG samples into CLT.v and checks the outputs.
- README.md  → project description.
There are no subdirectories: this is a single-module HDL design plus its testbench.

##### Architectural insights from the README
- No loops in code → fully unrolled/pipelined hardware implementation.
- It processes “actual samples of an ECG signal” to detect QRS peaks via CLT.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Device Under Test (DUT)"
        direction TB
        ADC["ADC Input (ECG Sample)"]:::external
        ShiftReg["Shift-Register Pipeline"]:::storage
        CLTCore["CLT Core (Adder/Subtractor Pipeline)"]:::arithmetic
        Comparator["Comparator/Threshold Logic"]:::control
        OutRegs["Output Registers<br/>(Peak Value & Sample Index)"]:::storage
        ADC --> ShiftReg --> CLTCore --> Comparator --> OutRegs
    end

    subgraph "Testbench Harness"
        direction TB
        TB["test_clt.v<br/>($readmemh stimulus & output check)"]:::testbench
        TB --> ADC
        OutRegs --> TB
    end

    DOC["README.md<br/>(Project Documentation)"]:::external

    click ShiftReg "https://github.com/sanskar777/qrs-peak-detection-in-ecg-signals-using-verilog/blob/master/CLT.v"
    click CLTCore "https://github.com/sanskar777/qrs-peak-detection-in-ecg-signals-using-verilog/blob/master/CLT.v"
    click Comparator "https://github.com/sanskar777/qrs-peak-detection-in-ecg-signals-using-verilog/blob/master/CLT.v"
    click OutRegs "https://github.com/sanskar777/qrs-peak-detection-in-ecg-signals-using-verilog/blob/master/CLT.v"
    click ADC "https://github.com/sanskar777/qrs-peak-detection-in-ecg-signals-using-verilog/blob/master/CLT.v"
    click TB "https://github.com/sanskar777/qrs-peak-detection-in-ecg-signals-using-verilog/blob/master/test_clt.v"
    click DOC "https://github.com/sanskar777/qrs-peak-detection-in-ecg-signals-using-verilog/blob/master/README.md"

    classDef storage fill:#ADD8E6,stroke:#000;
    classDef arithmetic fill:#90EE90,stroke:#000;
    classDef control fill:#F08080,stroke:#000;
    classDef testbench fill:#D3D3D3,stroke-dasharray: 5 5,stroke:#000;
    classDef external fill:#FFFFFF,stroke:#000;
```
