Spaces:
Running on Zero
Running on Zero
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,14 +1,81 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
-
python_version: '3.12'
|
| 9 |
app_file: app.py
|
| 10 |
pinned: false
|
| 11 |
license: mit
|
|
|
|
| 12 |
---
|
| 13 |
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Marine Soundscape Analyzer
|
| 3 |
+
emoji: π
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: indigo
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 5.23.3
|
|
|
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: mit
|
| 11 |
+
short_description: Coral reef acoustic analysis
|
| 12 |
---
|
| 13 |
|
| 14 |
+
# π Marine Soundscape Analyzer
|
| 15 |
+
|
| 16 |
+
A comprehensive acoustic analysis tool for **marine and coral reef hydrophone recordings**.
|
| 17 |
+
|
| 18 |
+
## Features
|
| 19 |
+
|
| 20 |
+
Upload any audio file (WAV, MP3, FLAC, OGG, AIFF) and get:
|
| 21 |
+
|
| 22 |
+
| Tab | Content |
|
| 23 |
+
|-----|---------|
|
| 24 |
+
| π Waveform | Time-domain signal with amplitude envelope |
|
| 25 |
+
| π Spectrograms | Linear, Mel-scale, and Log-frequency spectrograms |
|
| 26 |
+
| π‘ Frequency Analysis + MFCC | Power Spectral Density (Welch), spectral centroid over time, MFCC heatmap |
|
| 27 |
+
| 𧬠Acoustic Indices | ACI, BI, NDSI, ADI, RMS β all shown as time-series bars |
|
| 28 |
+
| π Temporal Features | Spectral bandwidth, rolloff, flatness, ZCR, onset detection, MFCC delta |
|
| 29 |
+
| π Report | Full markdown report with all statistics and index interpretations |
|
| 30 |
+
|
| 31 |
+
## Acoustic Indices
|
| 32 |
+
|
| 33 |
+
| Index | Reference | What it measures |
|
| 34 |
+
|-------|-----------|-----------------|
|
| 35 |
+
| **ACI** β Acoustic Complexity Index | Pieretti et al. 2011 | Temporal variation in spectral amplitude; higher = more complex soundscape |
|
| 36 |
+
| **BI** β Bioacoustic Index | Boelman et al. 2007 | Energy in the 2β8 kHz biological band |
|
| 37 |
+
| **NDSI** β Normalized Difference Soundscape Index | Kasten et al. 2012 | Ratio of biotic (2β11 kHz) to anthropogenic (1β2 kHz) energy |
|
| 38 |
+
| **ADI** β Acoustic Diversity Index | Villanueva-Rivera et al. 2011 | Shannon diversity across frequency bands above a threshold |
|
| 39 |
+
| **Hf** β Spectral Entropy | Sueur et al. 2008 | Uniformity of energy across frequencies; 0 = tonal, 1 = white noise |
|
| 40 |
+
| **Ht** β Temporal Entropy | Sueur et al. 2008 | Uniformity of energy over time; 0 = impulsive, 1 = stationary |
|
| 41 |
+
| **H** β Total Acoustic Entropy | Sueur et al. 2008 | Combined soundscape heterogeneity (Hf Γ Ht) |
|
| 42 |
+
|
| 43 |
+
## Marine Coral Reef Context
|
| 44 |
+
|
| 45 |
+
| Frequency Band | Range | Typical Sources |
|
| 46 |
+
|----------------|-------|-----------------|
|
| 47 |
+
| Low | 20 β 1,000 Hz | Fish choruses, breaking waves, vessel traffic |
|
| 48 |
+
| Snapping Shrimp | 1 β 5 kHz | *Alpheid* snapping shrimp β key reef health indicator |
|
| 49 |
+
| High Biotic | 5 β 20 kHz | Small crustaceans, urchins, high-frequency fish sounds |
|
| 50 |
+
|
| 51 |
+
Snapping shrimp produce a characteristic broadband crackling that can be heard throughout the 1β20 kHz range. Healthy reefs typically show **high ACI, positive NDSI, and elevated energy in the snapping-shrimp band**. Degraded reefs tend to be quieter, with lower ACI and flatter spectra.
|
| 52 |
+
|
| 53 |
+
## Example Recordings
|
| 54 |
+
|
| 55 |
+
The app ships with example recordings from the project data folder:
|
| 56 |
+
|
| 57 |
+
- π¦ Snapping Shrimp
|
| 58 |
+
- π¦ Ghost Crab: Gastric Mill Stridulation
|
| 59 |
+
- π Humpback Whale Song
|
| 60 |
+
- π Red Grouper Vocalization
|
| 61 |
+
|
| 62 |
+
## Running Locally
|
| 63 |
+
|
| 64 |
+
```bash
|
| 65 |
+
pip install -r requirements.txt
|
| 66 |
+
python app.py
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
## Deploying to Hugging Face Spaces
|
| 70 |
+
|
| 71 |
+
1. Create a new **Gradio** Space on [huggingface.co/spaces](https://huggingface.co/spaces).
|
| 72 |
+
2. Upload `app.py` and `requirements.txt` to the Space repository.
|
| 73 |
+
3. (Optional) Add audio example files under `data/` in the Space repo β the app will auto-detect them.
|
| 74 |
+
|
| 75 |
+
## References
|
| 76 |
+
|
| 77 |
+
- Pieretti N., Farina A., Morri D. (2011). A new methodology to infer the singing activity of an avian community: The Acoustic Complexity Index (ACI). *Ecological Indicators*.
|
| 78 |
+
- Boelman N.T., et al. (2007). Multi-trophic invasion resistance in Hawaii: bioacoustics, field surveys, and airborne remote sensing. *Ecological Applications*.
|
| 79 |
+
- Kasten E.P., et al. (2012). The remote environmental assessment laboratory's acoustic library: An archive for studying soundscape ecology. *Ecological Informatics*.
|
| 80 |
+
- Villanueva-Rivera L.J., et al. (2011). A primer of acoustic analysis for landscape ecologists. *Landscape Ecology*.
|
| 81 |
+
- Sueur J., Pavoine S., Hamerlynck O., Duvail S. (2008). Rapid acoustic survey for biodiversity appraisal. *PLOS ONE*.
|