Audio Brightness Classifier — Quick Reference

Simple spectral analysis tool: classifies audio brightness using spectral centroid calculation with four frequency bands optimized for music analysis.

Author: Shai Cohen Version: 1.0 Category: Analysis
Contents:

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

  1. Select a Sound object in Praat
  2. Run the script
  3. View the classification result in the Info window
Output format: soundname: 845 Hz → bright
The number shows the calculated spectral centroid in Hz, followed by the brightness category.

Algorithm

Frequency Bands

BandRange (Hz)DescriptionDefault
Bass100 - low_freqLow frequencies100-200 Hz
Low Midlow_freq - mid_freqLower midrange200-1000 Hz
High Midmid_freq - high_freqUpper midrange1000-4000 Hz
Highhigh_freq - 10000High frequencies4000-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

ParameterDefaultDescription
low_freq200 HzBass/low-mid crossover
mid_freq1000 HzLow-mid/high-mid crossover
high_freq4000 HzHigh-mid/high crossover

Classification System

🎵 Brightness Categories

Five-level classification based on spectral centroid:

CategoryCentroid RangeSound CharacteristicsExamples
very_dark< 300 HzBass-heavy, muffledBass drum, tuba, low piano
dark300-600 HzWarm, full-bodiedCello, French horn, vocal baritone
medium600-1200 HzBalanced, naturalSpeech, acoustic guitar, violin
bright1200-2000 HzClear, presentTrumpet, flute, female vocals
very_bright≥ 2000 HzSharp, piercingCymbals, 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