# kit-ibt/ecgdeli architecture

> Architecture diagram of the GitHub repository kit-ibt/ecgdeli, 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/kit-ibt/ecgdeli
- Repository: https://github.com/kit-ibt/ecgdeli

## Overview

##### Project type and purpose
- ECGdeli is a MATLAB toolbox (library) for ECG signal filtering and waveform delineation.
- It is **not** a client/server or web app, but a scientific processing toolkit composed of modular algorithms and example scripts.

##### File structure
- Top-level directories:
- Filtering — contains baseline, high/low/notch/isoline filters
- ECG_Processing — contains detection and annotation routines (P-wave, QRS, T-wave, FPT table)
- Example — demo script and sample ECG data
- Config files: `.gitignore`, `CODE_OF_CONDUCT.md`, CITATION, LICENSE
- No build scripts or deployment descriptors—usage is direct in MATLAB.

##### Additional insights from README
- Describes two main pipelines:
a) **Filtering pipeline** (baseline removal, band filters, isoline correction)
b) **Delineation pipeline** (feature extraction, template creation, synchronization, fiducial point table output)
- Lists MATLAB toolbox dependencies: image, signal, statistics, wavelet.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Data Input
    ECGData["Input ECG Data\n(.mat)"]:::data
    click ECGData "https://github.com/kit-ibt/ecgdeli/blob/master/Example/s0273lre_signal.mat"

    %% Filtering Pipeline
    subgraph "Filtering Pipeline"
        direction TB
        Baseline["Baseline Removal"]:::filter
        click Baseline "https://github.com/kit-ibt/ecgdeli/blob/master/Filtering/ECG_Baseline_Removal.m"
        Highpass["Highpass Filter"]:::filter
        click Highpass "https://github.com/kit-ibt/ecgdeli/blob/master/Filtering/ECG_High_Filter.m"
        Lowpass["Lowpass Filter"]:::filter
        click Lowpass "https://github.com/kit-ibt/ecgdeli/blob/master/Filtering/ECG_Low_Filter.m"
        Bandpass["Bandpass Filter"]:::filter
        click Bandpass "https://github.com/kit-ibt/ecgdeli/blob/master/Filtering/ECG_High_Low_Filter.m"
        Notch["Notch Filter"]:::filter
        click Notch "https://github.com/kit-ibt/ecgdeli/blob/master/Filtering/Notch_Filter.m"
        Isoline["Isoline Correction"]:::filter
        click Isoline "https://github.com/kit-ibt/ecgdeli/blob/master/Filtering/Isoline_Correction.m"
    end

    %% Delineation Pipeline
    subgraph "Delineation Pipeline"
        direction TB
        QRS["R-peak Detection"]:::delineation
        click QRS "https://github.com/kit-ibt/ecgdeli/blob/master/ECG_Processing/QRS_Detection.m"
        PWave["P-wave Detection"]:::delineation
        click PWave "https://github.com/kit-ibt/ecgdeli/blob/master/ECG_Processing/P_Detection.m"
        TWave["T-wave Detection"]:::delineation
        click TWave "https://github.com/kit-ibt/ecgdeli/blob/master/ECG_Processing/T_Detection.m"
        Template["Template Generation"]:::delineation
        click Template "https://github.com/kit-ibt/ecgdeli/blob/master/ECG_Processing/Create_Template.m"
        AmpFeatures["Extract Amplitude Features"]:::delineation
        click AmpFeatures "https://github.com/kit-ibt/ecgdeli/blob/master/ECG_Processing/ExtractAmplitudeFeaturesFromFPT.m"
        IntFeatures["Extract Interval Features"]:::delineation
        click IntFeatures "https://github.com/kit-ibt/ecgdeli/blob/master/ECG_Processing/ExtractIntervalFeaturesFromFPT.m"
        SyncR["Sync R-Peaks"]:::delineation
        click SyncR "https://github.com/kit-ibt/ecgdeli/blob/master/ECG_Processing/Sync_R_Peaks.m"
        SyncBeats["Sync Beats"]:::delineation
        click SyncBeats "https://github.com/kit-ibt/ecgdeli/blob/master/ECG_Processing/Sync_Beats.m"
        SyncCh["Sync Channels"]:::delineation
        click SyncCh "https://github.com/kit-ibt/ecgdeli/blob/master/ECG_Processing/Sync_Channels.m"
        Annotate["Annotate ECG Multi"]:::delineation
        click Annotate "https://github.com/kit-ibt/ecgdeli/blob/master/ECG_Processing/Annotate_ECG_Multi.m"
    end

    %% Example / Demo
    subgraph "Example / Demo"
        direction TB
        ExampleScript["Demo Script"]:::example
        click ExampleScript "https://github.com/kit-ibt/ecgdeli/blob/master/Example/Annotate_ExampleECG.m"
        FPTTable["FPT Table Output"]:::output
    end

    %% External Dependencies
    External["MATLAB Toolboxes"]:::external

    %% Connections
    ECGData --> Baseline
    Baseline --> Highpass --> Lowpass --> Bandpass --> Notch --> Isoline
    Isoline --> QRS
    Isoline --> PWave
    Isoline --> TWave
    QRS --> Template
    PWave --> Template
    TWave --> Template
    Template --> AmpFeatures --> IntFeatures --> SyncR --> SyncBeats --> SyncCh --> Annotate --> FPTTable
    ExampleScript --> ECGData
    ExampleScript --> FPTTable
    External -.-> Baseline
    External -.-> Highpass
    External -.-> Lowpass
    External -.-> Bandpass
    External -.-> Notch
    External -.-> Isoline
    External -.-> QRS
    External -.-> PWave
    External -.-> TWave
    External -.-> Template
    External -.-> AmpFeatures
    External -.-> IntFeatures
    External -.-> SyncR
    External -.-> SyncBeats
    External -.-> SyncCh
    External -.-> Annotate

    %% Styles
    classDef filter fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef delineation fill:#90EE90,stroke:#333,stroke-width:1px
    classDef example fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef data fill:#FFFACD,stroke:#333,stroke-width:1px
    classDef output fill:#FFE4B5,stroke:#333,stroke-width:1px
    classDef external stroke-dasharray: 5 5,stroke:#444,fill:#EEE,stroke-width:1px
```
