Загрузка...

ESP32-C3 Sound Reactive FFT Sine Wave Visualizer

This project uses an ESP32-C3, an OLED display (SSD1306), and an analog sound sensor to visualize live audio signals with animated sine waves that react to bass, midrange, and treble frequencies. Using the arduinoFFT library, the system performs real-time frequency analysis and displays three stacked dancing sine waves, each representing a different audio band. Enhanced sensitivity and bright rendering techniques make it suitable for music-reactive art, AV meters, or compact audio visualizations.

Component ESP32-C3 GPIO
OLED SDA GPIO 7
OLED SCL GPIO 6
Sound Sensor GPIO 4 (analog)
Libraries Required
Make sure to install:
• Adafruit_SSD1306
• Adafruit_GFX
• arduinoFFT (by Kosme, or equivalent) not working on my ESP32C3 so I improvised my own, but your ESP32 might work.

What It Does:
• Uses FFT to split the audio spectrum into:
o Bass (2–12 bins)
o Mid (7–20)
o Treble (21–32)
• Each group animates its own sine wave dancer, smoothly scrolling.
• Waves are stacked vertically for clarity.

To Use:
• Check the Serial Monitor at 115200 baud to see FFT bin values.
• You’ll see 3 stacked sine waves on the OLED, each modulated by a frequency range.
• Adjust getAverage() bin ranges for different bass/mid/treble behavior.
• 1. Boost sensitivity (GAIN adjustment):
• Right now:
• const float GAIN = 2.5;
• Try:
• const float GAIN = 5.0; // Increase as needed, up to 10
• This amplifies small ADC differences. You can also auto-scale with peak tracking if desired.
• ________________________________________
• 2. Optional: Apply nonlinear gain (to make low sounds more visible):
• Replace this line inside loop():
• vReal[i] = centered;
• With:
• vReal[i] = pow(abs(centered), 1.2) * (centered 0 ? -1 : 1);
• This gives boost to quieter signals while preserving wave shape.

Code:
https://github.com/ukkokalevala/3FFT_Sin_Wave.git

Видео ESP32-C3 Sound Reactive FFT Sine Wave Visualizer канала Electricum
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять