Hi-Fi Portable Bluetooth Speaker with DSP Technology
personal

Hi-Fi Portable Bluetooth Speaker with DSP Technology

📅 Jun 01, 2021

Jun 12, 2022

(12 months)

👤 Client: Personal Project

High-end portable bluetooth speaker featuring ESP32-based DSP, custom enclosure design, and real-time frequency response correction.

🛠️ Technologies

  • ESP32
  • C
  • MATLAB
  • I2S
  • Embedded
  • DSP

🏷️ Roles & Skills

    Audio EngineeringDSPEmbedded SystemsElectronics DesignAcoustic EngineeringSignal ProcessingHardware DesignFirmware Development

📝 Overview

Design and implementation of a portable wireless speaker with professional-grade sound quality, combining advanced DSP algorithms, custom acoustic design, and embedded systems engineering. Features real-time digital signal processing, active crossover networks, and precise frequency response correction for audiophile-level performance.

🖼️ Gallery

Hi-Fi Portable Bluetooth Speaker with DSP Technology screenshotHi-Fi Portable Bluetooth Speaker with DSP Technology screenshotHi-Fi Portable Bluetooth Speaker with DSP Technology screenshotHi-Fi Portable Bluetooth Speaker with DSP Technology screenshotHi-Fi Portable Bluetooth Speaker with DSP Technology screenshotHi-Fi Portable Bluetooth Speaker with DSP Technology screenshotHi-Fi Portable Bluetooth Speaker with DSP Technology screenshotHi-Fi Portable Bluetooth Speaker with DSP Technology screenshotHi-Fi Portable Bluetooth Speaker with DSP Technology screenshotHi-Fi Portable Bluetooth Speaker with DSP Technology screenshot

Introduction

This project aims to design and build the best possible portable speaker in terms of sound quality, battery life, and versatility. The system incorporates a wide variety of technologies including bluetooth connectivity, Digital Signal Processing (DSP), advanced acoustic baffle design methods, and microcontroller-based control.

Project Objectives

Needs:

  • Bluetooth connectivity with high-quality audio streaming
  • Sufficient acoustic power for open-air environments
  • Extended battery life (5+ hours of continuous playback)
  • Flat frequency response across the audible spectrum
  • User-programmable DSP transfer function
  • Weather-resistant construction materials

Limitations:

  • Maximum dimensions: 350×200×200mm (portable backpack size)
  • Weight constraints for portability
  • Power consumption optimization

Technical Considerations:

  • Speaker bandwidth is dependent on enclosure size
  • Battery capacity limits internal component volume
  • Each processing stage accumulates impact on final sound quality
  • Precise electro-mechanical modeling required for optimal enclosure design

System Architecture

Block Diagram

The following diagram illustrates the complete signal processing chain from bluetooth reception to acoustic output:

Block Diagram Figure 1. System block diagram showing signal flow through DSP stages

The system processes audio through multiple stages:

  1. Bluetooth A2DP reception on ESP32
  2. Digital crossover filtering (200Hz cutoff)
  3. Frequency response correction using parametric EQ
  4. Digital-to-Analog conversion (dual PCM5102A DACs)
  5. Class-D amplification (PAM8610 for tweeters, TPA3118 for woofer)
  6. Acoustic reproduction (2.1 configuration)

Hardware Components

Acoustic Drivers

Mid-High Tweeters (Stereo)

  • 2× 2” paper cone drivers
  • Rated power: 5W each
  • Frequency range: 200Hz - 20kHz

Tweeter Figure 2. 2-inch tweeter driver

Woofer (Mono)

  • 4” paper cone driver
  • Rated power: 25W
  • High efficiency for extended battery life
  • Frequency range: 75Hz - 200Hz

Woofer Figure 3. 4-inch woofer driver

Digital Processing & Control

ESP32 SoC (Espressif)

  • Dual-core 240MHz processor
  • Integrated Bluetooth, Wi-Fi, and radio
  • 16-bit I2S audio interface
  • Real-time FreeRTOS operating system
  • Low power consumption

ESP32 Figure 4. ESP32 development board

Dual PCM5102A DAC Modules

  • 4 independent audio output channels
  • 112dB SNR
  • Sampling frequency: up to 384kHz
  • 32-bit resolution
  • I2S/PCM interface
  • Integrated high-performance audio PLL
  • Operating voltage: 3.3V / 5V

DAC Figure 5. PCM5102A DAC decoder board

Power Amplification

Tweeter Amplifier (Stereo)

  • PAM8610 Class-D amplifier
  • 15+15W output power
  • High sampling frequency for quality HF reproduction
  • Minimal signal discretization artifacts

Tweeter Amplifier Figure 6. PAM8610 stereo amplifier

Woofer Amplifier (Mono)

  • TPA3118 Class-D amplifier
  • 60W maximum output power
  • High efficiency for battery operation
  • Optimized for low-frequency reproduction

Woofer Amplifier Figure 7. TPA3118 mono amplifier

Power System

Battery Pack

  • 3S Li-Ion configuration (3× 3.7V cells)
  • Nominal voltage: 11.1V
  • Maximum voltage: 12.6V
  • BMS based on BM3451 IC
  • Charge/discharge cycle management
  • 5-8 hour runtime

BMS Figure 8. Battery Management System


Test Equipment & Software

Measurement Hardware

Behringer ECM8000 Measurement Microphone

  • Omnidirectional polar pattern
  • Flat frequency response
  • Professional acoustic measurement capability

Measurement Microphone Figure 9. Behringer ECM8000

Komplete Audio 2 Interface

  • High-precision ADC
  • Low-noise signal conditioning
  • Dual-channel measurement capability

Audio Interface Figure 10. Native Instruments Komplete Audio 2

Rigol DS1054Z Oscilloscope

  • Signal quality verification
  • Channel delay measurement
  • Synchronization testing

Software Tools

  • ESP-IDF: C programming environment with FreeRTOS
  • Visual Studio Code: Primary development IDE
  • MATLAB: Filter design and transfer function simulation
  • WinISD: Speaker enclosure simulation software
  • REW (Room EQ Wizard): Acoustic measurement and analysis
  • Fusion 360: 3D modeling for enclosure design

Acoustic Design Process

Driver Characterization

Free-Air Frequency Response

Open-baffle measurements provide baseline driver performance without enclosure effects:

Woofer Response

  • Achieves 90Hz in free-air configuration
  • Target: 75Hz with bass-reflex enclosure and DSP enhancement

Woofer FR Figure 11. Woofer open-baffle frequency response

Tweeter Response

  • Excellent high-frequency extension
  • Natural rolloff below 200Hz
  • ~220Hz resonance peak (corrected via DSP)

Tweeter FR Figure 12. Tweeter open-baffle frequency response

Thiele-Small Parameter Measurement

Electro-mechanical coefficients were measured using the added mass method:

  1. Free-air impedance measurement: Driver suspended horizontally
  2. Added mass measurement: Known mass added to cone
  3. REW analysis: Calculate T/S parameters from impedance data

Free Air Measurement Figure 13. Free-air impedance measurement setup

Added Mass Measurement Figure 14. Added mass impedance measurement

Measurement Results:

Thiele-Small Parameters Figure 15. Calculated Thiele-Small parameters for woofer

Enclosure Simulation

Bass-Reflex Design Parameters:

  • Tuning frequency: 75Hz (optimized for bandwidth extension)
  • Internal volume: 4.7 liters
  • Port area: Calculated to limit air velocity to less than 25 m/s at 20W
  • Port length: Determined by WinISD simulation

WinISD Simulation Figure 16. WinISD enclosure simulation

3D Modeling & Manufacturing

The enclosure was designed in Fusion 360 with careful consideration for:

  • Acoustic performance
  • Structural integrity
  • Manufacturing feasibility
  • Component integration
  • Serviceability

Construction:

  • Wooden panels: 2× 6mm plywood layers (laser cut)
  • Front panel: 3D printed ABS plastic
  • Separable bass-reflex tube for tuning flexibility
  • Integrated threaded inserts for repeated assembly
  • Hydrophobic varnish finish for weather resistance
  • Internal acoustic damping material

Enclosure Model Figure 17. 3D model of front panel

Tube Model Figure 18. Separable bass-reflex tube


Digital Signal Processing Implementation

ESP32 Firmware Development

Bluetooth A2DP Reception:

  • Modified ESP-IDF a2dp_sink example project
  • Implemented logarithmic volume control (16 steps, -2dB per step)
  • Configured dual I2S peripherals for 2.1 output
  • 44.1kHz sampling rate, 16-bit resolution

Volume Control Implementation:

// Logarithmic volume lookup table
static uint8_t logarithm[16] = {
  0, 0.03, 0.05, 0.06, 0.08, 0.1, 0.13, 0.16,
  0.2, 0.25, 0.32, 0.4, 0.5, 0.63, 0.79, 1
};

DSP Algorithm Architecture

Woofer Processing Chain:

  1. Stereo-to-mono downmix
  2. 200Hz 2nd-order Butterworth low-pass filter
  3. 78Hz parametric boost (bass enhancement)
  4. Overflow protection limiter
  5. Mono output to right DAC channel

Tweeter Processing Chain:

  1. Stereo channel separation
  2. 200Hz 1st-order high-pass filter
  3. 2kHz parametric cut (resonance correction)
  4. Stereo output to left/right DAC channels

Filter Design & Discretization

Low-Pass Filter (Woofer Crossover):

  • Type: 2nd-order Butterworth
  • Cutoff: 200Hz (1250 rad/s)
  • Quality factor: 0.707
  • Continuous transfer function
  • Discretization method: Zero-Order Hold (ZOH)
  • Discrete transfer function

Low-Pass Response Figure 19. Measured low-pass filter frequency response

High-Pass Filter (Tweeter Crossover):

  • Type: 1st-order (complements sealed enclosure natural rolloff)
  • Cutoff: 200Hz (1250 rad/s)
  • Continuous transfer function
  • Discrete transfer function

High-Pass Response Figure 20. Measured high-pass filter frequency response

Parametric EQ Filters:

  • 78Hz bass boost (bell filter, Q=2.5)
  • 2kHz treble cut (bell filter, Q=1.5, gain=0.4)

Assembly & Integration

Electronics Integration

Circuit Assembly Figure 21. PCM5102A DACs and ESP32 on perfboard (top view)

Circuit Bottom Figure 22. Perfboard assembly (bottom view)

All components mounted on 3D-printed plastic plate for robust integration.

Final Assembly

Hardware Assembly Figure 23. Hardware components before enclosure installation

Completed Speaker Figure 24. Final assembled product

Features:

  • USB programming port
  • Battery charging port (USB-C)
  • Power switch
  • Function button
  • 2× 3.5mm jack outputs (for development/measurement)

Acoustic Measurement & Calibration

Measurement Setup

Measurements conducted in acoustically treated LEDE (Live-End Dead-End) room:

  • Microphone distance: 1 meter
  • Pink noise stimulus
  • REW analysis software

Measurement Process Figure 25. Acoustic measurement in treated room

Raw Frequency Response

Full System (2.1 Configuration):

Uncorrected FR Figure 26. Initial frequency response before DSP correction

Observations:

  • Bass region requires boost (matched via 78Hz parametric EQ)
  • Crossover transition is smooth (200Hz)
  • 2.5kHz resonance requires reduction

Individual Channel Measurements:

Right Channel Figure 27. Right tweeter and woofer response

Left Channel Figure 28. Left tweeter and woofer response

Corrected Frequency Response

After DSP calibration:

Corrected Full System Figure 29. Final frequency response after DSP correction

Single Channel (High-Frequency Detail):

Tweeter Final Figure 30. Right channel frequency response showing treble extension

Achieved Performance:

  • ±3dB from 75Hz to 18kHz
  • Smooth crossover transition
  • Minimal resonance artifacts
  • Professional-grade linearity

Performance Optimization

Computational Efficiency

Initial floating-point implementation caused sample drops due to ESP32 FPU limitations. Optimizations included:

  1. Discretization method selection: Choose ZOH vs. Tustin based on computational cost
  2. Mathematical optimization: Use distributive property to reduce multiplications
  3. Buffer size tuning: Balance latency vs. processing overhead

Example Optimization:

// Unoptimized
ly = 0.986 * u - 0.986 * lu_1 + 0.972 * ly_1;

// Optimized (fewer multiplications)
ly = 0.986 * (u - lu_1) + 0.972 * ly_1;

Technical Specifications

ParameterValue
Frequency Range75Hz - 18kHz (±3dB)
Configuration2.1 (stereo tweeters and mono woofer)
Crossover Frequency200Hz (active digital)
Maximum Power18.7W (measured with pink noise)
Battery Life5-8 hours (60% volume typical)
Idle Power Consumption3.3W (MCU and buck converter)
Sampling Rate44.1kHz
Bit Depth16-bit
BluetoothA2DP profile
DimensionsLess than 350×200×200mm
DAC SNR112dB
Amplifier ClassClass-D (high efficiency)

Results & Conclusions

Achievements

Sound Quality: Flat frequency response delivering audiophile-grade performance
Portability: Compact form factor with 5-8 hour battery life
DSP Integration: Real-time processing with less than 2ms latency
Custom Design: Optimized acoustic enclosure with precise tuning
Versatility: Programmable DSP allows future enhancements

Lessons Learned

Acoustic Measurement:

  • Room modes affect measurements even in treated spaces
  • Anechoic chamber would improve calibration accuracy
  • Multiple measurement positions reveal spatial response variations

DSP Implementation:

  • Floating-point operations require careful optimization on ESP32
  • ZOH vs. Tustin discretization choice impacts computational load
  • Buffer sizing critical for real-time performance

Power Management:

  • MCU idle consumption significant (3.3W baseline)
  • Class-D amplification essential for battery operation
  • Future optimization: sleep modes when idle

Future Enhancements

  • Implement power-saving modes
  • Add extra bass boost mode
  • Battery level indicator
  • Volume control interface
  • Wi-Fi streaming capability
  • Multi-room audio synchronization

Bibliography

  1. Vance Dickason. The Loudspeaker Design Cookbook. Audio Amateur Press, 2007.
  2. Thiele/Small parameters. Wikipedia, 2022.
  3. Knud Thorborg and Claus Futtrup. “Electrodynamic Transducer Model Incorporating Semi-Inductance.” J. Audio Eng. Soc, 2011.
  4. Morten H. Knudsen. “Low-Frequency Loudspeaker Models That Include Suspension Creep.” JAES, 1993.
  5. Ethan Winer. The Audio Expert: Everything You Need to Know About Audio. Routledge, 2017.

This project demonstrates the integration of acoustic engineering, digital signal processing, and embedded systems design to create a professional-grade portable audio solution.