Skip to content

Repository files navigation

ESP32 Audio Dynamic Compressor / Limiter

mit digitalem Ein- und Ausgang und Analogausgang, optional mit analogem Eingang,
Web Interface über WiFi und IR Remote zur Steuerung, Programmierung über USB.

with digital input and output and analogue output, optionally with analogue input,
Web interface via WiFi and IR Remote for control, and programming via USB. 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

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
IR Empfänger TSOP4838 o.ä.
Optionaler ADC: PCM1802 Stereo-A/D-Wandler

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
LED GREEN GPIO12 5V GND
LED RED GPIO21 5V GND
IR RECEIVER GPIO39 (IR_IN) 3V3 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 Compressor6.ino auskommentieren. Der Compressor arbeitet dann im mono Betrieb
Mit der IR Remote kann nur der Threshold eingestellt werden.
Die IR Remote muss in IR_Remote.h konfiguriert werden.
Alles weitere siehe Compressor6.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 Compressor6.ino.
The compressor then works in mono mode.
With IR Remote you can change only the threshold.
The IR Remote has to be configered in IR_Remote.h.
For everything else, see Compressor6.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

Packages

Contributors

Languages