Numerix-DSP Home Page  

Case Study: USB And Bluetooth Audio Active Loudspeaker



Introduction

Cool Loudspeaker
The mid-range loudspeaker market is a fine balance between the low cost and quality consumer market space and the high cost and quality audiophile end of the market.

A modern method of balancing this trade-off is to incorporate Digital Signal Processing (DSP) functionality to digitally enhance the overall system level performance.

Designing analog audio products, such as loudspeakers is an art and while many analog experts have some cross-over knowledge into the DSP space, most do not have the deep knowledge required to develop optimized DSP algorithms.

For this active loudspeaker, the customer had already chosen the powerful and flexible XMOS XU216 device, see side panel for more details.

Our team were an integral part of developing a USB/Bluetooth audio active loudspeaker design for a major Chinese loudspeaker manufacturer.

XMOS xCORE-200 XU216 Overview

The XMOS XU216 is a flexible microcontroller with powerful DSP capabilities:

Number of Cores   16
MIPS   2000
Memory   512 kBytes
GPIO Pins   128
USB Audio   Class 1 and
Class 2 Support
Sample Rates   Standard Rates
Upto 384 kHz

A sample rate of 192 KHz was chosen for the system, which is comfortably
within the capabilities of the XU216 which supports 384 kHz by default.

Implementation Details

The xCORE-200 allows the partitioning of the required functionality across the multiple cores. In particular the USB audio datapath can easily be separated from the DSP cores. In this application, the DSP functionality was implemented using the highly optimized lib_dsp provided by XMOS and this is all partitioned onto Tile #1. A high level diagram of the data flow is shown in Figure 1.

The high level system requirements were:
Active Loudspeaker High Level Diagram

Figure 1 – High Level Diagram Of Active Loudspeaker.


The architecture of the XMOS XU216 allowed easy partitioning of the required data flow across the available cores in such a way that the real-time processing could execute in parallel to the background control processing. This is particularly important in applications such as this where user control (e.g. tone control) requires the modification of filter parameters using such mathematical functions as sine and cosine. In many applications these functions are implemented using look-up tables however this limits flexibility or requires large amounts of memory.

If we think about the requirement for "real-time" handling of human interfaces, "real-time" means tens or hundreds of milliseconds - as long as the user does not perceive a delay between adjusting the control and hearing the result. So these mathematical functions are considered soft real-time but, critically, their latency must not prevent the device from meeting the hard real-time requirements of the audio chain. In the case of the xCORE-200, the mathematical functions can easily be partitioned onto a separate core away from the main auido processing cores and in fact were all partitioned onto a single core, along with all of the other soft real-time functions, such as handling and responding to commands from the host microcontroller.

The flexibility of the architecture also allowed a core to be allocated to implementing the I2C bus and protocol that was used to connect to a simple microcontoller for interfacing to external control devices such as switches and potentiometers for volume and tone controls etc.

One interesting question is why use a separate I2C bus for the control path when there is already a USB and the xCORE-200 is a very flexible microcontroller ?
The answer is that one of the goals for this project is that the module should be retro fittable to existing products and also have scalability to fit into future, as yet unplanned, products.

Active Loudspeaker Flow Diagram

Figure 2 - Flow Diagram Of Active Loudspeaker.

Graphical Equalizer / Tone Control

Figure 3 shows the frequencies of the filter bank arrangement used in this application. All of the filters were implemented using Biquad IIR filters and at the maximum sample rate of 192 kHz, there was little room left for the required tone controls so it was decided to wrap the two sets of functions into one at the control level so that the tone control would also modify the graphical equalizer response in the three standard bands - bass, middle and treble.

10th Order Graphical Equalizer Filter Frequencies

Figure 3 - 10th Order Graphical Equalizer Filter Frequencies.

Figure 4 shows the simple Java host applications that were used by the customer for tuning the product response. These applications were not provided by the customer to the end user, who could only control the response using the front panel controls.

These controls allowed the design engineers at the customer a far greater control over the response of each product in the range.

Java Host Tuning Controls

Figure 4 - Java Host Tuning Controls.

Conclusion

The final solution provides a flexible base solution for re-use in a wide range of different active loudspeaker product formats.

Having the full source code for the solution meant that the end user will always be able to make maximum use of re-usability should they wish to add further enhancements and functionality in the future.

References

[1] Oppenheim, A. V. and Schafer, R. W., (1989), "Discrete Time Signal Processing", Prentice-Hall Inc., USA.

[2] Pirkle, Will C., (2012), Designing Audio Effect Plug-Ins in C++: With Digital Audio Signal Processing Theory, O'Reilly, USA.

[3] XMOS Semiconductors Ltd., "USB Audio Software Design Guide", UK. https://www.xmos.ai/file/usb-audio-software-design-guide/

[4] XMOS Semiconductors Ltd., "xCORE-200 Multichannel Audio Platform Hardware Manual", UK. https://www.xmos.ai/file/xcore-200-multichannel-audio-platform-hardware-manual/

[5] XMOS Semiconductors Ltd., "Fundamentals of USB-Audio", UK. https://www.xmos.ai/file/fundamentals-of-usb-audio/

[6] USB Implementers Forum, "Universal Serial Bus Device Class Definition for Audio Devices", USA. https://usb.org/sites/default/files/audio10.pdf



YouTube 
Email Numerix
Email

Copyright© 2022 Sigma Numerix Ltd.. Permission is granted to create WWW pointers to this document.
SigLib, Digital Filter Plus and Numerix-DSP are trademarks of Sigma Numerix Ltd. All other trademarks acknowledged.