# amitaymanor/speaker-authentication-system architecture

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

- Interactive diagram: https://gitdiagram.com/amitaymanor/speaker-authentication-system
- Repository: https://github.com/amitaymanor/speaker-authentication-system

## Overview

##### Detailed Component Breakdown

A. Input Processing Layer (Top)
- Audio Input Component (entry point)
- Pre-processing Pipeline (from pre_process.py)
- Silence Removal
- Audio Normalization
- File Operations Handler (from file_ops.py)

B. Feature Processing Layer (Middle)
- LPCC Feature Extractor (from features_extraction.py)
- 20 Coefficients Processing
- Signal Processing Components
- Feature Vector Generation

C. Authentication Layer (Bottom)
- Database Processing (from db_process.py)
- Gaussian Naive Bayes Classifier
- Decision Engine

##### Specific Design Elements

Components should be represented as follows:
- External Interfaces: Clouds or rounded rectangles

##### Technical Details

Annotations showing:
- LPCC coefficient count (20)
- Threshold value (0.99)
- Prior probabilities [0.2, 0.8]
- Performance metrics (99.7% accuracy)

##### Critical Connections

Interactions:
- Audio input → Pre-processing
- Pre-processing → Feature Extraction
- Feature Extraction → Classification
- Database → Training Process
- Classification → Authentication Decision

##### System States

State indicators for:
- Training Mode
- Threshold Computation Mode
- Authentication Mode

- The linear nature of the processing pipeline
- Clear separation between processing stages
- The role of each component in the three main operational modes
- Data transformation flow from raw audio to authentication decision

- State indicators
- Performance metrics
- Technical parameters

- The O(n) complexity of the system
- The mobile-first design considerations
- The text-independent nature of the system
- The integration points between components

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Define styles
    classDef processing fill:#b3d1ff,stroke:#333,stroke-width:2px
    classDef storage fill:#90EE90,stroke:#333,stroke-width:2px
    classDef decision fill:#FFE5B4,stroke:#333,stroke-width:2px
    classDef interface fill:#E8E8E8,stroke:#333,stroke-width:2px

    %% Input Processing Layer
    subgraph InputLayer["Input Processing Layer"]
        AudioInput([Audio Input]):::interface
        PreProcess[Pre-processing Pipeline]:::processing
        FileOps[File Operations Handler]:::processing
        
        AudioInput --> PreProcess
        PreProcess --> FileOps
    end

    %% Feature Processing Layer
    subgraph FeatureLayer["Feature Processing Layer"]
        LPCC[LPCC Feature Extractor]:::processing
        FeatureVector[Feature Vector Generation]:::processing
        
        subgraph LPCCDetails["LPCC Processing"]
            Coeff["20 Coefficients"]:::processing
            SignalProc["Signal Processing"]:::processing
        end
        
        LPCC --> LPCCDetails
        LPCCDetails --> FeatureVector
    end

    %% Authentication Layer
    subgraph AuthLayer["Authentication Layer"]
        DB[(Database)]:::storage
        GNB[Gaussian Naive Bayes]:::processing
        Decision{Authentication Decision}:::decision
        
        DB --> GNB
        GNB --> Decision
    end

    %% Connections between layers
    FileOps --> LPCC
    FeatureVector --> GNB

    %% System States
    subgraph States["System States"]
        Training["Training Mode"]:::interface
        Threshold["Threshold Mode"]:::interface
        Auth["Authentication Mode"]:::interface
    end

    %% Technical Parameters
    subgraph Params["Parameters"]
        ThresholdVal["Threshold: 0.99"]:::interface
        Priors["Priors: [0.2, 0.8]"]:::interface
        Accuracy["Accuracy: 99.7%"]:::interface
    end

    %% Click events for component mapping
    click PreProcess "https://github.com/AmitayManor/Speaker-Authentication-System/blob/main/pre_proccess.py"
    click FileOps "https://github.com/AmitayManor/Speaker-Authentication-System/blob/main/file_ops.py"
    click LPCC "https://github.com/AmitayManor/Speaker-Authentication-System/blob/main/features_extraction.py"
    click DB "https://github.com/AmitayManor/Speaker-Authentication-System/blob/main/db_process.py"
    click Decision "https://github.com/AmitayManor/Speaker-Authentication-System/blob/main/app_logic.py"
    click AudioInput "https://github.com/AmitayManor/Speaker-Authentication-System/blob/main/main.py"
    click DB "https://github.com/AmitayManor/Speaker-Authentication-System/tree/main/threshold_db_test/"
    click Decision "https://github.com/AmitayManor/Speaker-Authentication-System/blob/main/threshold_db_test/out_threshold_test.txt"

    %% Legend
    subgraph Legend["Legend"]
        L1[Processing Component]:::processing
        L2[(Storage Component)]:::storage
        L3{Decision Point}:::decision
        L4([Interface]):::interface
    end
```
