Audio Brightness Classifier — Quick Reference
Simple spectral analysis tool: classifies audio brightness using spectral centroid calculation with four frequency bands optimized for music analysis.
What this does
This script performs audio brightness classification by calculating the spectral centroid of a sound and categorizing it into one of five brightness levels. It uses four frequency bands optimized for musical analysis to determine whether a sound is "very dark," "dark," "medium," "bright," or "very bright."
What is spectral centroid? The spectral centroid represents the "center of mass" of the frequency spectrum — essentially the average frequency weighted by amplitude. Higher centroid values indicate brighter sounds with more high-frequency content, while lower values indicate darker sounds dominated by lower frequencies.
Quick start
- Select a Sound object in Praat
- Run the script
- View the classification result in the Info window
Output format:
The number shows the calculated spectral centroid in Hz, followed by the brightness category.
soundname: 845 Hz → brightThe number shows the calculated spectral centroid in Hz, followed by the brightness category.
Algorithm
Frequency Bands
| Band | Range (Hz) | Description | Default |
|---|---|---|---|
| Bass | 100 - low_freq | Low frequencies | 100-200 Hz |
| Low Mid | low_freq - mid_freq | Lower midrange | 200-1000 Hz |
| High Mid | mid_freq - high_freq | Upper midrange | 1000-4000 Hz |
| High | high_freq - 10000 | High frequencies | 4000-10000 Hz |
Spectral Centroid Calculation
# Get energy in each band
bass = Get band energy: 100, low_freq
low_mid = Get band energy: low_freq, mid_freq
high_mid = Get band energy: mid_freq, high_freq
high_freq_energy = Get band energy: high_freq, 10000
# Calculate weighted average using band centers
total_energy = bass + low_mid + high_mid + high_freq_energy
if total_energy > 0
spectral_centroid = ((bass × 150) + (low_mid × 600) +
(high_mid × 2500) + (high_freq_energy × 7500)) / total_energy
else
spectral_centroid = 0
endif
Customization Parameters
| Parameter | Default | Description |
|---|---|---|
| low_freq | 200 Hz | Bass/low-mid crossover |
| mid_freq | 1000 Hz | Low-mid/high-mid crossover |
| high_freq | 4000 Hz | High-mid/high crossover |
Classification System
🎵 Brightness Categories
Five-level classification based on spectral centroid:
| Category | Centroid Range | Sound Characteristics | Examples |
|---|---|---|---|
| very_dark | < 300 Hz | Bass-heavy, muffled | Bass drum, tuba, low piano |
| dark | 300-600 Hz | Warm, full-bodied | Cello, French horn, vocal baritone |
| medium | 600-1200 Hz | Balanced, natural | Speech, acoustic guitar, violin |
| bright | 1200-2000 Hz | Clear, present | Trumpet, flute, female vocals |
| very_bright | ≥ 2000 Hz | Sharp, piercing | Cymbals, piccolo, violin harmonics |
Application ideas:
- Audio content analysis and tagging
- Instrument recognition preprocessing
- Equalization preset selection
- Music information retrieval systems
- Educational tool for spectral understanding