# m-r-s/fade architecture

> Architecture diagram of the GitHub repository m-r-s/fade, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/m-r-s/fade
- Repository: https://github.com/m-r-s/fade

## Overview

a. Primary Flow:
- Corpus → Processing → Features → Training → Recognition → Evaluation → Figures

- fade-config → config directories → individual modules

##### Module Details (Use nested components)

a. Feature Extraction Module:
- MFCC Processor
- GBFB Processor
- SGBFB Variants
- Log-Mel Spectrogram

b. Processing Module:
- OpenMHA Integration
- Signal Processing Scripts
- Batch Processing System

- Export/Import System
- Project Forking Mechanism
- Parallel Processing Support

Key Architectural Considerations:

##### Modular Design
- Clear separation between different processing stages
- Plugin architecture for feature extractors
- Configuration independence

##### Integration Points (Use interface symbols)
- HTK Integration
- MATLAB/Octave Interface
- Audio Processing Tools

- Blue: Core Framework Components
- Green: Data Processing Modules
- Yellow: External Dependencies
- Orange: Storage Components
- Purple: Configuration Components

- Component type indicators

Special Considerations:

##### Scientific workflow nature
- Experiment configuration flow
- Data generation paths
- Evaluation points

##### Extensibility
- Plugin architecture for features
- Corpus customization points
- Processing pipeline extension points

##### Parallel processing capabilities
- Parallel execution paths
- Resource management
- Synchronization points

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Core Framework
    subgraph Core
        FC[FADE Core Controller]:::core
        CM[Configuration Manager]:::core
    end
    click FC "https://github.com/m-r-s/fade/tree/master/fade"
    click CM "https://github.com/m-r-s/fade/tree/master/fade-config"

    %% Corpus Management
    subgraph Corpus
        MCH[Matrix Corpus Handler]:::corpus
        SCH[Stimulus Corpus Handler]:::corpus
        CG[Corpus Generator]:::corpus
        CF[Corpus Formatter]:::corpus
    end
    click MCH "https://github.com/m-r-s/fade/tree/master/fade.d/corpus-matrix"
    click SCH "https://github.com/m-r-s/fade/tree/master/fade.d/corpus-stimulus"
    click CG "https://github.com/m-r-s/fade/tree/master/fade.d/corpus-generate"
    click CF "https://github.com/m-r-s/fade/tree/master/fade.d/corpus-format"

    %% Processing Pipeline
    subgraph Processing
        FEM[Feature Extraction Module]:::processing
        TM[Training Module]:::processing
        RM[Recognition Module]:::processing
        EM[Evaluation Module]:::processing
    end
    click FEM "https://github.com/m-r-s/fade/tree/master/fade.d/features"
    click TM "https://github.com/m-r-s/fade/tree/master/fade.d/training"
    click RM "https://github.com/m-r-s/fade/tree/master/fade.d/recognition"
    click EM "https://github.com/m-r-s/fade/tree/master/fade.d/evaluation"

    %% Feature Extraction Details
    subgraph Features
        MFCC[MFCC Processor]:::feature
        GBFB[GBFB Processor]:::feature
        SGBFB[SGBFB Variants]:::feature
        LMS[Log-Mel Spectrogram]:::feature
    end
    click MFCC "https://github.com/m-r-s/fade/tree/master/fade.d/features.d/mfcc"
    click GBFB "https://github.com/m-r-s/fade/tree/master/fade.d/features.d/gbfb"
    click SGBFB "https://github.com/m-r-s/fade/tree/master/fade.d/features.d/sgbfb"
    click LMS "https://github.com/m-r-s/fade/tree/master/fade.d/features.d/logmelspec"

    %% Processing Module Details
    subgraph ProcessingDetails
        OMHA[OpenMHA Integration]:::processing
        BPS[Batch Processing System]:::processing
    end
    click OMHA "https://github.com/m-r-s/fade/tree/master/fade.d/processing.d/openMHA"
    click BPS "https://github.com/m-r-s/fade/tree/master/fade.d/processing.d/copy/batch_process"

    %% Project Management
    subgraph ProjectMgmt
        EXP[Export System]:::mgmt
        IMP[Import System]:::mgmt
        FORK[Project Forking]:::mgmt
        PP[Parallel Processing]:::mgmt
    end
    click EXP "https://github.com/m-r-s/fade/tree/master/fade.d/export"
    click IMP "https://github.com/m-r-s/fade/tree/master/fade.d/import"
    click FORK "https://github.com/m-r-s/fade/tree/master/fade.d/fork"
    click PP "https://github.com/m-r-s/fade/tree/master/fade.d/parallel"

    %% External Dependencies
    subgraph External
        HTK[Hidden Markov Toolkit]:::external
        MATLAB[MATLAB/Octave Engine]:::external
        APT[Audio Processing Tools]:::external
    end
    click MATLAB "https://github.com/m-r-s/fade/tree/master/scripts/run-matlab"

    %% Data Storage
    DS[(Data Storage)]:::storage
    CS[(Corpus Storage)]:::storage
    FS[(Feature Storage)]:::storage
    MS[(Model Storage)]:::storage
    RS[(Results Storage)]:::storage

    %% Connections
    FC --> CM
    CM -.-> Corpus
    CM -.-> Processing
    CM -.-> Features
    CM -.-> ProcessingDetails
    
    MCH --> CS
    SCH --> CS
    CG --> CS
    CF --> CS
    
    CS --> FEM
    FEM --> FS
    FS --> TM
    TM --> MS
    MS --> RM
    RM --> RS
    RS --> EM
    
    FEM --> |uses| MFCC
    FEM --> |uses| GBFB
    FEM --> |uses| SGBFB
    FEM --> |uses| LMS
    
    ProcessingDetails --> |integrates| HTK
    ProcessingDetails --> |integrates| MATLAB
    ProcessingDetails --> |integrates| APT
    
    ProjectMgmt --> DS
    
    %% Styles
    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef corpus fill:#2ecc71,stroke:#27ae60,color:white
    classDef processing fill:#e74c3c,stroke:#c0392b,color:white
    classDef feature fill:#f1c40f,stroke:#f39c12,color:black
    classDef external fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef storage fill:#9b59b6,stroke:#8e44ad,color:white
    classDef mgmt fill:#e67e22,stroke:#d35400,color:white

    %% Legend
    subgraph Legend
        L1[Core Components]:::core
        L2[Corpus Handlers]:::corpus
        L3[Processing Modules]:::processing
        L4[Feature Extractors]:::feature
        L5[External Tools]:::external
        L6[(Storage)]:::storage
        L7[Project Management]:::mgmt
    end
```
