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:
Figure 1. System block diagram showing signal flow through DSP stages
The system processes audio through multiple stages:
- Bluetooth A2DP reception on ESP32
- Digital crossover filtering (200Hz cutoff)
- Frequency response correction using parametric EQ
- Digital-to-Analog conversion (dual PCM5102A DACs)
- Class-D amplification (PAM8610 for tweeters, TPA3118 for woofer)
- 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
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
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
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
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
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
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
Figure 8. Battery Management System
Test Equipment & Software
Measurement Hardware
Behringer ECM8000 Measurement Microphone
- Omnidirectional polar pattern
- Flat frequency response
- Professional acoustic measurement capability
Figure 9. Behringer ECM8000
Komplete Audio 2 Interface
- High-precision ADC
- Low-noise signal conditioning
- Dual-channel measurement capability
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
Figure 11. Woofer open-baffle frequency response
Tweeter Response
- Excellent high-frequency extension
- Natural rolloff below 200Hz
- ~220Hz resonance peak (corrected via DSP)
Figure 12. Tweeter open-baffle frequency response
Thiele-Small Parameter Measurement
Electro-mechanical coefficients were measured using the added mass method:
- Free-air impedance measurement: Driver suspended horizontally
- Added mass measurement: Known mass added to cone
- REW analysis: Calculate T/S parameters from impedance data
Figure 13. Free-air impedance measurement setup
Figure 14. Added mass impedance measurement
Measurement Results:
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
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
Figure 17. 3D model of front panel
Figure 18. Separable bass-reflex tube
Digital Signal Processing Implementation
ESP32 Firmware Development
Bluetooth A2DP Reception:
- Modified ESP-IDF
a2dp_sinkexample 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:
- Stereo-to-mono downmix
- 200Hz 2nd-order Butterworth low-pass filter
- 78Hz parametric boost (bass enhancement)
- Overflow protection limiter
- Mono output to right DAC channel
Tweeter Processing Chain:
- Stereo channel separation
- 200Hz 1st-order high-pass filter
- 2kHz parametric cut (resonance correction)
- 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
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
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
Figure 21. PCM5102A DACs and ESP32 on perfboard (top view)
Figure 22. Perfboard assembly (bottom view)
All components mounted on 3D-printed plastic plate for robust integration.
Final Assembly
Figure 23. Hardware components before enclosure installation
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
Figure 25. Acoustic measurement in treated room
Raw Frequency Response
Full System (2.1 Configuration):
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:
Figure 27. Right tweeter and woofer response
Figure 28. Left tweeter and woofer response
Corrected Frequency Response
After DSP calibration:
Figure 29. Final frequency response after DSP correction
Single Channel (High-Frequency Detail):
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:
- Discretization method selection: Choose ZOH vs. Tustin based on computational cost
- Mathematical optimization: Use distributive property to reduce multiplications
- 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
| Parameter | Value |
|---|---|
| Frequency Range | 75Hz - 18kHz (±3dB) |
| Configuration | 2.1 (stereo tweeters and mono woofer) |
| Crossover Frequency | 200Hz (active digital) |
| Maximum Power | 18.7W (measured with pink noise) |
| Battery Life | 5-8 hours (60% volume typical) |
| Idle Power Consumption | 3.3W (MCU and buck converter) |
| Sampling Rate | 44.1kHz |
| Bit Depth | 16-bit |
| Bluetooth | A2DP profile |
| Dimensions | Less than 350×200×200mm |
| DAC SNR | 112dB |
| Amplifier Class | Class-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
- Vance Dickason. The Loudspeaker Design Cookbook. Audio Amateur Press, 2007.
- Thiele/Small parameters. Wikipedia, 2022.
- Knud Thorborg and Claus Futtrup. “Electrodynamic Transducer Model Incorporating Semi-Inductance.” J. Audio Eng. Soc, 2011.
- Morten H. Knudsen. “Low-Frequency Loudspeaker Models That Include Suspension Creep.” JAES, 1993.
- 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.
