# foamyfsky/noisy_pattern_detect architecture

> Architecture diagram of the GitHub repository foamyfsky/noisy_pattern_detect, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/foamyfsky/noisy_pattern_detect
- Repository: https://github.com/foamyfsky/noisy_pattern_detect

## Overview

Noise Sentinel is a local acoustic-burst detector for one laptop. Its main workflow accepts generated, uploaded, or microphone audio; extracts acoustic features; detects and merges burst events; optionally stores them; and presents event summaries and time-based forecasts and anomaly scores in a Streamlit dashboard. SQLite event history feeds the time models, while CSV export supports taking records out of the app. The README documents the workflow; some dashboard and export wiring is only partially excerpted, so uncertain links are omitted.

Main entry points: [`app.py`](https://github.com/foamyfsky/noisy_pattern_detect/blob/main/app.py) (Streamlit dashboard), [`noisy_pattern_detect/storage.py`](https://github.com/foamyfsky/noisy_pattern_detect/blob/main/noisy_pattern_detect/storage.py) (Event persistence and export), [`noisy_pattern_detect/pipeline.py`](https://github.com/foamyfsky/noisy_pattern_detect/blob/main/noisy_pattern_detect/pipeline.py) (Analysis pipeline), [`noisy_pattern_detect/signal_processing.py`](https://github.com/foamyfsky/noisy_pattern_detect/blob/main/noisy_pattern_detect/signal_processing.py) (Acoustic features)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Dashboard"]
  node_dashboard["Streamlit dashboard<br/>[app.py]"]
  node_summaries["Event summaries<br/>[reporting.py]"]
end

subgraph group_audio["Audio analysis"]
  node_demo["Demo audio<br/>[demo.py]"]
  node_capture["WAV and mic capture<br/>[audio_capture.py]"]
  node_features["Acoustic features"]
  node_detection["Burst detection<br/>[detection.py]"]
  node_config["Detection and model settings<br/>[config.py]"]
  node_pipeline["Analysis pipeline<br/>[pipeline.py]"]
end

subgraph group_events["Event records"]
  node_storage["Event persistence and export<br/>[storage.py]"]
  node_sqlite[("SQLite event database")]
  node_csv["CSV event export"]
end

subgraph group_models["Time models"]
  node_intensity["Time-of-day intensity<br/>[models.py]"]
  node_forecast["Poisson forecast and anomaly<br/>[models.py]"]
end

node_user(("Laptop user"))

node_user -->|"uses"| node_dashboard
node_dashboard -->|"generates"| node_demo
node_dashboard -->|"loads or records"| node_capture
node_dashboard -->|"extracts features"| node_features
node_dashboard -->|"detects events"| node_detection
node_pipeline -->|"extracts features"| node_features
node_pipeline -->|"detects events"| node_detection
node_pipeline -->|"optionally stores"| node_storage
node_dashboard -->|"loads and stores"| node_storage
node_storage -->|"reads and writes"| node_sqlite
node_storage -->|"exports"| node_csv
node_dashboard -->|"summarizes events"| node_summaries
node_dashboard -->|"requests intensity"| node_intensity
node_dashboard -->|"requests scores"| node_forecast
node_intensity -->|"supplies rate"| node_forecast
node_config -.->|"configures"| node_features
node_config -->|"configures"| node_detection

click node_dashboard "https://github.com/foamyfsky/noisy_pattern_detect/blob/main/app.py"
click node_summaries "https://github.com/foamyfsky/noisy_pattern_detect/blob/main/noisy_pattern_detect/reporting.py"
click node_demo "https://github.com/foamyfsky/noisy_pattern_detect/blob/main/noisy_pattern_detect/demo.py"
click node_capture "https://github.com/foamyfsky/noisy_pattern_detect/blob/main/noisy_pattern_detect/audio_capture.py"
click node_features "https://github.com/foamyfsky/noisy_pattern_detect/blob/main/noisy_pattern_detect/signal_processing.py"
click node_detection "https://github.com/foamyfsky/noisy_pattern_detect/blob/main/noisy_pattern_detect/detection.py"
click node_config "https://github.com/foamyfsky/noisy_pattern_detect/blob/main/noisy_pattern_detect/config.py"
click node_pipeline "https://github.com/foamyfsky/noisy_pattern_detect/blob/main/noisy_pattern_detect/pipeline.py"
click node_storage "https://github.com/foamyfsky/noisy_pattern_detect/blob/main/noisy_pattern_detect/storage.py"
click node_intensity "https://github.com/foamyfsky/noisy_pattern_detect/blob/main/noisy_pattern_detect/models.py"
click node_forecast "https://github.com/foamyfsky/noisy_pattern_detect/blob/main/noisy_pattern_detect/models.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dashboard,node_summaries,node_user toneBlue
class node_demo,node_capture,node_features,node_detection,node_config,node_pipeline toneAmber
class node_storage,node_sqlite,node_csv toneMint
class node_intensity,node_forecast toneRose
```

## Components

### Dashboard

- [Streamlit dashboard](https://github.com/foamyfsky/noisy_pattern_detect/blob/main/app.py): `app.py`
- [Event summaries](https://github.com/foamyfsky/noisy_pattern_detect/blob/main/noisy_pattern_detect/reporting.py): `noisy_pattern_detect/reporting.py`

### Audio analysis

- [Demo audio](https://github.com/foamyfsky/noisy_pattern_detect/blob/main/noisy_pattern_detect/demo.py): `noisy_pattern_detect/demo.py`
- [WAV and mic capture](https://github.com/foamyfsky/noisy_pattern_detect/blob/main/noisy_pattern_detect/audio_capture.py): `noisy_pattern_detect/audio_capture.py`
- [Acoustic features](https://github.com/foamyfsky/noisy_pattern_detect/blob/main/noisy_pattern_detect/signal_processing.py): `noisy_pattern_detect/signal_processing.py`
- [Burst detection](https://github.com/foamyfsky/noisy_pattern_detect/blob/main/noisy_pattern_detect/detection.py): `noisy_pattern_detect/detection.py`
- [Detection and model settings](https://github.com/foamyfsky/noisy_pattern_detect/blob/main/noisy_pattern_detect/config.py): `noisy_pattern_detect/config.py`
- [Analysis pipeline](https://github.com/foamyfsky/noisy_pattern_detect/blob/main/noisy_pattern_detect/pipeline.py): `noisy_pattern_detect/pipeline.py`

### Event records

- [Event persistence and export](https://github.com/foamyfsky/noisy_pattern_detect/blob/main/noisy_pattern_detect/storage.py): `noisy_pattern_detect/storage.py`
- **SQLite event database**
- **CSV event export**

### Time models

- [Time-of-day intensity](https://github.com/foamyfsky/noisy_pattern_detect/blob/main/noisy_pattern_detect/models.py): `noisy_pattern_detect/models.py`
- [Poisson forecast and anomaly](https://github.com/foamyfsky/noisy_pattern_detect/blob/main/noisy_pattern_detect/models.py): `noisy_pattern_detect/models.py`

### Other components

- **Laptop user**

## Connections

- Laptop user → Streamlit dashboard: uses (evidence: `README.md`)
- Streamlit dashboard → Demo audio: generates (evidence: `app.py`)
- Streamlit dashboard → WAV and mic capture: loads or records (evidence: `app.py`)
- Streamlit dashboard → Acoustic features: extracts features (evidence: `app.py`)
- Streamlit dashboard → Burst detection: detects events (evidence: `app.py`)
- Analysis pipeline → Acoustic features: extracts features (evidence: `noisy_pattern_detect/pipeline.py`)
- Analysis pipeline → Burst detection: detects events (evidence: `noisy_pattern_detect/pipeline.py`)
- Analysis pipeline → Event persistence and export: optionally stores (evidence: `noisy_pattern_detect/pipeline.py`)
- Streamlit dashboard → Event persistence and export: loads and stores (evidence: `app.py`)
- Event persistence and export → SQLite event database: reads and writes (evidence: `noisy_pattern_detect/storage.py`)
- Event persistence and export → CSV event export: exports (evidence: `noisy_pattern_detect/storage.py`)
- Streamlit dashboard → Event summaries: summarizes events (evidence: `app.py`)
- Streamlit dashboard → Time-of-day intensity: requests intensity (evidence: `app.py`)
- Streamlit dashboard → Poisson forecast and anomaly: requests scores (evidence: `app.py`)
- Time-of-day intensity → Poisson forecast and anomaly: supplies rate (evidence: `noisy_pattern_detect/models.py`)
- Detection and model settings → Acoustic features: configures (evidence: `noisy_pattern_detect/signal_processing.py`)
- Detection and model settings → Burst detection: configures (evidence: `noisy_pattern_detect/detection.py`)
