# b-tice/audio_processing_matlab architecture

> Architecture diagram of the GitHub repository b-tice/audio_processing_matlab, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/b-tice/audio_processing_matlab
- Repository: https://github.com/b-tice/audio_processing_matlab

## Overview

##### Main Components

a) Signal Generation Layer
- `tonegen.m` and related synthesis modules at the foundation
- `am_synth.m` and various additive synthesis components
- `cymbal_additive_synth.m` and its part files together

b) Signal Processing Layer
- `waveshaping.m` and `chebyshev_poly.m` as transformation modules
- `lininterp.m` for interpolation processing

c) Analysis Layer
- `spectrum_magnitudes.m` at this level
- `plotspec.m` for visualization components

##### Component Relationships

- Use a vertical flow from signal generation → processing → analysis
- Which components can be used independently vs. those that are interdependent

##### Detailed Component Groupings

a) Synthesis Group:
- [am_synth.m]
- [clar_additive_synth.m]
- [cymbal_additive_synth.m]
- [cymbal_part1_additive_synth.m]
- [cymbal_part2_additive_synth.m]
- [dexter.m]

b) Processing Group:
- [waveshaping.m]
- [chebyshev_poly.m]
- [lininterp.m]

c) Analysis Group:
- [spectrum_magnitudes.m]
- [plotspec.m]

##### Documentation Notes

- Brief descriptions of each module's function
- Typical signal flow patterns for common use cases
- Performance-critical paths
- Where error handling occurs

## Diagram (Mermaid)

```mermaid
graph TB
    %% Style Definitions
    classDef synthesis fill:#90EE90,stroke:#333,stroke-width:2px
    classDef processing fill:#87CEEB,stroke:#333,stroke-width:2px
    classDef analysis fill:#DDA0DD,stroke:#333,stroke-width:2px
    classDef group fill:none,stroke:#666,stroke-width:2px,stroke-dasharray: 5 5

    subgraph SynthesisLayer["Signal Generation Layer"]
        TG[Tone Generator]:::synthesis
        AMS[AM Synthesizer]:::synthesis
        CLS[Clarinet Synthesizer]:::synthesis
        
        subgraph CymbalGroup["Cymbal Synthesis"]
            CYM[Cymbal Synthesizer]:::synthesis
            CYM1[Cymbal Part 1]:::synthesis
            CYM2[Cymbal Part 2]:::synthesis
            
            CYM --> CYM1
            CYM --> CYM2
        end
        
        DEX[Dexter Synthesizer]:::synthesis
    end

    subgraph ProcessingLayer["Signal Processing Layer"]
        WS[Waveshaping]:::processing
        CP[Chebyshev Polynomial]:::processing
        LI[Linear Interpolation]:::processing
        
        CP --> WS
    end

    subgraph AnalysisLayer["Analysis Layer"]
        SA[Spectrum Analysis]:::analysis
        SV[Spectrum Visualization]:::analysis
        
        SA --> SV
    end

    %% Connections between layers
    TG --> WS
    AMS --> WS
    CLS --> WS
    CYM --> WS
    DEX --> WS
    
    WS --> SA
    LI --> SA

    %% Click events for component mapping
    click TG "https://github.com/b-tice/audio_processing_matlab/blob/main/tonegen.m"
    click AMS "https://github.com/b-tice/audio_processing_matlab/blob/main/am_synth.m"
    click CLS "https://github.com/b-tice/audio_processing_matlab/blob/main/clar_additive_synth.m"
    click CYM "https://github.com/b-tice/audio_processing_matlab/blob/main/cymbal_additive_synth.m"
    click CYM1 "https://github.com/b-tice/audio_processing_matlab/blob/main/cymbal_part1_additive_synth.m"
    click CYM2 "https://github.com/b-tice/audio_processing_matlab/blob/main/cymbal_part2_additive_synth.m"
    click DEX "https://github.com/b-tice/audio_processing_matlab/blob/main/dexter.m"
    click WS "https://github.com/b-tice/audio_processing_matlab/blob/main/waveshaping.m"
    click CP "https://github.com/b-tice/audio_processing_matlab/blob/main/chebyshev_poly.m"
    click LI "https://github.com/b-tice/audio_processing_matlab/blob/main/lininterp.m"
    click SA "https://github.com/b-tice/audio_processing_matlab/blob/main/spectrum_magnitudes.m"
    click SV "https://github.com/b-tice/audio_processing_matlab/blob/main/plotspec.m"

    %% Legend
    subgraph Legend
        L1[Signal Generation]:::synthesis
        L2[Signal Processing]:::processing
        L3[Analysis]:::analysis
    end
```
