Skip to content

wavoigt/ESP32-Audio-Dynamic-Compressor

Repository files navigation

ESP32 Audio Dynamic Compressor / Limiter

mit digitalem Ein- und Ausgang und Analogausgang, optional mit analogem Eingang,
Web Interface zur Steuerung und OTA Programmierung.

with digital input and output and analogue output, optionally with analogue input,
Web interface for control and OTA programming. English -> scroll down

Ich verwende diese Schaltung zwischen TV und Soundsystem, um die zum Teil sehr hohe Dynamik von Spielfilmen einzuschränken.
Diese Anleitung ist nicht für Anfänger gedacht.
Grundlegende Kenntnisse in Programmierung mit der Arduino IDE setze ich voraus.

Compr_von_oben_kl

Web Interface
WebInterface

Hardware:

ESP32 Wrover Board mit PCM5100A 32bit Stereo DAC 'HiFi-ESP32' https://github.com/sonocotta/esp32-audio-dock
Das Board passt genau in ein Raspberry Pi Gehäuse.
Alternativ kann jedes ESP32 Wrover Board mit 4Mb Flash und 4Mb PSRam verwendet werden (ohne DAC)
ToslinkBee SPDIF zu I2S Converter:
https://www.audiophonics.fr/en/interface-modules/tinysine-toslinkbee-interface-module-spdif-optical-to-i2s-dir9001-cs8421-24bit-96khz-p-18397.html
Optical Toslink Output Socket on PCB
https://www.audiophonics.fr/en/optical-toslink-plugs/optical-toslink-output-socket-on-pcb-p-17103.html
Optionaler ADC: PCM1802 Stereo-A/D-Wandler, erhältlich bei Amazon

Verdrahtung:

I2S DATA (Label) I2S CLK (Label) I2S WS (Label) V+ GND
PCM5100A (onboard) GPIO22 GPIO26 GPIO25 3V3 GND
TOSLINKBEE GPIO19 (MISO) GPIO18 (CLK) GPIO14 (RST) 5V GND
TOSLINK OUT GPIO23 (MOSI) 5V GND

Software:

Die Software ist für die Arduino IDE gedacht.

Anleitung:

Leider ist der Dynamic Compressor in der arduino-audio-tools library nur für mono Betrieb ausgelegt.
Für Stereo Betrieb musste ich die files AudioEffects.h and AudioEffect.h modifizieren.
Kopiere die files AudioEffects.h and AudioEffect.h in den Arduino library folder:
Arduino\libraries\audio-tools\src\AudioTools\CoreAudio\AudioEffects
Falls du die Original files verwenden möchtest, musst du die Zeilen mit 'Compressor_Stereo' und 'Compressor_Active' in der Compressor4.ino auskommentieren. Der Compressor arbeitet dann im mono Betrieb
In CompHtmlServer.h müssen die Wifi Zugangsdaten eingetragen werden.
Alles weitere siehe Compressor4.ino

Der Compressor in der Original Library (AudioEffect.h) tut was er soll, aber bei hohen Kompressionsraten neigt er leider zur 'Überkompression', d.h bei lauten Passagen wird das Signal zu stark zurückgeregelt.
Ich habe ihn vollständig ersetzt durch einen Limiter, der sehr zufriedenstellend arbeitet
Dabei habe ich aufgrund der begrenzten Prozessorleistung des ESP32 auf nichtlineare Berechnungen verzichtet, wie exp(), log() etc.
Ideen und Verbesserungsvorschläge sind willkommen :-)

English:

I use this circuit between TV and sound system to limit the high dynamics of feature films.
These instructions are not intended for beginners.
Basic knowledge of programming with the Arduino IDE is required.

Unfortunately, the Dynamic Compressor in the arduino-audio-tools library is only designed for mono operation.
For stereo operation I had to modify the files AudioEffects.h and AudioEffect.h.
Copy the files AudioEffects.h and AudioEffect.h into the Arduino library folder:
Arduino\libraries\audio-tools\src\AudioTools\CoreAudio\AudioEffects
If you want to use the original files, you must comment out the lines with ‘Compressor_Stereo’ and ‘Compressor_Active’ in Compressor4.ino.
The compressor then works in mono mode.
The Wifi access data must be entered in CompHtmlServer.h.
For everything else, see Compressor4.ino

The compressor in the original library (AudioEffect.h) does what it should, but at high compression rates it unfortunately tends to ‘overcompress’, i.e. the signal is reduced too much in loud passages.
I replaced it completely with a limiter, which works very satisfactorily
Due to the limited processing power of the ESP32, I have dispensed with non-linear calculations such as exp(), log() etc.
Ideas and suggestions for improvement are welcome :-)

Translated with DeepL.com (free version)

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published