Skip to content

Kristian8606/ESP32_DSP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESP32 DSP

6884FAFA-050E-4CCE-93F6-6EF75651843B

ESP32_DSP

Configure Filters

Screenshots

Audio Processing with DIR9001 and TDA1387

Project Overview

ESP32_DSP is a project that uses the ESP32 as a Digital Signal Processor (DSP) for real-time audio processing. The system takes digital audio input from a DIR9001, processes it on the ESP32 using various filters (e.g., low-pass, high-pass, band-pass, notch, peak, low shelf, and high shelf filters), and sends the processed data to a TDA1387, which outputs an analog audio signal.

System Architecture

DIR9001:

A digital audio receiver that converts S/PDIF input into I2S output. It serves as the audio source and clock synchronizer.

ESP32:

The core DSP processor that applies various digital filters to the audio signal and outputs it as I2S.

TDA1387x8:

A high-quality Digital-to-Analog Converter (DAC) that transforms the processed digital signal into an analog audio output.

Features

Real-Time DSP:

Real-time audio signal processing on the ESP32.

  • Filter Options: The system supports multiple filter types, including:

  • Low-Pass Filter: Attenuates frequencies above the cutoff frequency.

  • High-Pass Filter: Attenuates frequencies below the cutoff frequency.

  • Band-Pass Filter: Passes frequencies within a specific range.

  • Notch Filter: Removes a narrow frequency band.

  • Peak Filter: Boosts or attenuates a specific frequency with adjustable Q-factor.

  • Low Shelf Filter: Boosts or cuts frequencies below a set threshold.

  • High Shelf Filter: Boosts or cuts frequencies above a set threshold.

Configurable Parameters:

Filters can be customized with the following parameters:

  • Center or cutoff frequency
  • Gain (boost or cut)
  • Q-factor (bandwidth control)

How It Works?

1.	Audio Input:

The DIR9001 receives a digital audio signal (S/PDIF) and converts it to I2S.

2.	DSP Processing:

The ESP32 processes the audio using the configured filters and applies real-time DSP algorithms.

3.	Audio Output:

The TDA1387 converts the processed I2S audio data into an analog signal, ready for playback through headphones or speakers.

Hardware Components

  • ESP32 microcontroller
  • DIR9001 Digital Audio Receiver
  • TDA1387 DAC
  • Audio Input: S/PDIF source
  • Audio Output: Amplifier or headphones

Hardware Connections

  • DIR9001 I2S Output → ESP32 I2S Input
  • ESP32 I2S Output → TDA1387 I2S Input
  • TDA1387 Analog Output → Amplifier or Headphones

//TODO add schematics for pins.

Setup Instructions

1.	Connect Hardware

Wire all components according to the Hardware Connections section.

2.	Install Software
git clone https://github.com/Kristian8606/ESP32_DSP.git
cd ESP32_DSP
idf.py build flash

Configure Filters

Edit the filter settings in Biquad.h to customize the DSP behavior:

In this array you need to specify the type of filter. PK , LP , HP and so on. In this case 6 filters PK - (PEAK FILTERS ) are set.

int type_filters[] = { PK      
                      ,PK
                      ,PK
                      ,PK
                      ,PK
                      ,PK
          
};

Here you set the filter frequency.

double Hz[] = { 72.50
              , 120.0
              , 224.0
              , 352.0  
              , 1279.0
              , 38.0
         

};

Here we set the gain in decibels.

double dB[] = { -4.80
              , -4.10
              , -2.80
              , -4.60
              , -3.30
              ,  10.0
            
};

And finally the Q of the filter.

double Qd[] = { 5.000
              , 5.000
              , 5.000
              , 3.066
              , 1.000
              , 7.0
              
};

Future Enhancements

  • Implement audio effects like reverb or delay.
  • Create a Bluetooth or Wi-Fi interface for real-time parameter adjustments.
  • Extended functionality to support multi-channel audio via additional ESP32s for tri-amping.

Screenshots

Screenshot 2024-11-28 at 18 26 12 Screenshot 2024-11-28 at 16 27 04 Screenshot 2024-11-28 at 16 37 57 Screenshot 2024-11-28 at 16 16 48 Screenshot 2024-11-28 at 16 18 41 Screenshot 2024-11-28 at 16 18 57 Screenshot 2024-11-28 at 16 24 18

License

This project is licensed under the GPL-3.0 License. See the LICENSE file for more details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published