Sigma DSP for active speaker systems ‐ application note Brewster LaMacchia 19‐Aug‐16 Momentum Data Systems http://www.mds.com

Introduction The availability of low cost, efficient, high performance class D devices in the past few years has enabled the use of in‐speaker electronics for better performance in not just but also in primary channels of consumer oriented audio components. The availability of A/D and D/A devices with enough dynamic range for high performance home audio has also been a key component in an active (powered) speaker design that uses DSP. While powered PA speakers for “Pro” audio have been available for a number of years, those systems typically lacked sophisticated signal processing and had limited performance parameters. Passive crossovers can be replaced with DSP based filters that allow optimal matching of and tweeters (2‐ way systems) or more complex multi‐band drivers. With increased DSP processing not only can filters be implemented, but extra equalization to flatten the system response (or tune it for a specific sound characteristic) can be performed. That same DSP device can also be used to implement features that protect the drivers from damage due to thermal (overheating) effects of high power levels, as well as prevent hard clipping of the amplifier and/or excessive driver excursion, which have very audible side effects (increased distortion and heating for the former, and popping noise and/or mechanical failure for the latter). MDS has developed hardware platforms for in speaker electronics based on Analog Device’s Sigma DSP. The Sigma DSP integrates a number of useful peripherals and has a very simple and low cost power supply design. The Sigma Studio tool allows non‐DSP experts to create the DSP applications needed to achieve maximum sound performance and high sound quality from lower cost transducers.1 The software programmable nature of the DSP based design also means that a common hardware platform can be used across multiple systems designs with the obvious savings in cost and development time for multiple end user products. Lastly the software based approach allows customer selection of processing features based on their personal preferences as well as handling equalization for differing placement in a room. This paper only looks at the considerations for in speaker DSP processing; the creation of multi‐speaker (surround) sources and bass management for systems that use a sub‐woofer is outside of the scope of this paper. Other aspects of speaker design are also only briefly summarized, but references to more in depth materials are included. From the development engineer’s perspective, in addition to an easy to use tool like Sigma Studio, is the availability of low cost desktop audio systems put together with soundscards and low cost and/or shareware

1 For more information about Sigma Studio see https://wiki.analog.com/resources/tools‐software/sigmastudio

1

software for signal generation and analysis. While final design will require a good test room and calibrated measurement equipment, a lot can be done outside of the test room to get the system initially prototyped and debugged. Even with these admissions of brevity and skipping of important detail, this paper may appear long to the casual reader. Despite being about sound, the topic is not one that lends itself to sound bites.

Summary In an active (powered) speaker there are typically 3 major PCB assemblies as illustrated in Figure 1:  Power supply – provides the higher voltage needed by the amplifier (typically 24 – 48V) as well as digital (3.3) and analog (+/‐ 15 or +5) power  – typically in the 25W to 100W/driver range for multiway speakers, and 300W or more for subwoofers.  DSP processor board – includes A/D and D/A

FIGURE 1 MAJOR COMPONENTS OF AN ACTIVE SPEAKER SYSTEM In a soundbar application there would typically be two (a simple stereo soundbar) sets of amplifiers and transducers or three sets (left, center, right). In a soundbar, which tend to be compact and thus have a low enclosure volume, an external is used for bass frequencies, typically the crossover is 120 Hz (small sound bars) to 80 Hz (larger soundbars). So called bookshelf sized speakers also typically require a subwoofer for good sound.

A typical speaker DSP processor board is described by the block diagram in Figure 2. A small microprocessor is usually used to manage the system operation. The amplifier and/or power supply may have temperature

2

measurement capability and the microprocessor can monitor those and signal the user should the system overheat. Systems that allow user adjustment of the speaker’s operation would use the microprocessor to manage the user interface. By keeping the system management tasks off of the DSP the DSP operation stays very deterministic, which is very desirable for real time audio applications as even getting a single sample delayed/wrong out of millions2 will be instantly perceived by the listener as a defective product.

FIGURE 2 SIGMA DSP CONTROLLER BOARD FOR AN ACTIVE SPEAKER The block diagram also includes an analog activity monitor that uses the microprocessor’s ADC input to detect when analog signal is present and the speaker should come out of low power standby3. While the diagram shows +/‐ analog supplies (for the op‐amps) it is possible to design a system (with slightly reduced performance) that operates with a single rail +5V analog supply. During customer development and system voicing ADI’s Sigma Studio USBi tool can be used to develop and test the DSP programs. Please see http://www.analog.com/en/design‐center/evaluation‐hardware‐and‐

2 Assuming a 48 kHz sample rate, one error out of 3 million samples would be a possible “pop” from the system once per minute. 3 A device like this active speaker must draw less than 0.5W in standby to be sold in many places in the world. The device must detect when no input is present and after some preset time period enter standby state. It is likewise desirable to exit the state when signal returns; the microprocessor has low power modes and can also power off the amplifiers and other DSP controller board components.

3

software/evaluation‐boards‐kits/eval‐adusb2ebz.html#eb‐overview for more information on USBi and the Sigma Studio tools. Once development is complete the output of the Sigma Studio tool is to a (header) .h file that is then compiled in to the microprocessor application software. The microprocessor software consists of two main parts; the speaker controller program (which includes the code to download to the Sigma DSP) and the bootloader/flash updater. It is also possible to have the Sigma DSP load code directly from an EEPROM at boot, but that architecture isn’t used here as:  Some have a digital interface with multiple input sample rates, and due to processing limits the application (and not just coefficients) needed to change at different sample rates.  Storage is already available in the microprocessor and an external SPI flash connected to it.  Code download over I2C is reasonably fast  Consistency with other MDS developed designs that combine a host plus DSP Other applications, particularly where the DSP program can not be field updated, may make more sense to be implemented as boot locally. Obviously a system that doesn’t need a microcontroller would also boot the DSP locally. The flash updater supports updating the speaker software from a USB port with the corresponding control software for this. The bootloader ensures that a failed firmware update can not result in a bricked speaker. Sampling rate is typically 48 kHz but with the higher performance Sigma DSP parts operation can be at 96 kHz. Internally the Sigma DSP is a 24 bit precision device for typical operations, with a block floating point scheme used to avoid digital overflow in intermediate calculations.

Other things to consider

While this paper focuses on the DSP and signal processing, this is a small subset of the issues faced by designers of active speakers. We assume the reader already has a general understanding of audio, see for example The Audio Expert (1). Unlike many electronics applications, speakers can not be miniaturized in to arbitrary form factors. The science of speaker design has to take in room acoustics (2) and mechanical consideration of the cabinet and the transducers (3). Speaker’s acoustic properties are a function of the type of and location in the room they are placed (4) and this also affects the design goals. There is also a visual aspect to the product – some speakers are hidden in walls, others are sculpted to look like avant‐garde art pieces. Besides performance, key considerations are the desired size and cost of the system as well as manufacturability. Speaker design was already a complex task before adding power hungry electronics inside of a sealed enclosure with exposure to high vibration levels. For example, what might be a normally simple task of selecting the audio input connectors and other items on the rear panel has to take in to account that the enclosure must be sealed (other than the port tube/opening in non‐ sealed designs) as small holes will produce whistling noises. Many designs will place the electronics inside of a basket that is mounted to the rear and provides an air seal. Doing this however can significantly change the volume of air inside of the speaker, which in turn affects many aspects of the speaker design.

4

In larger speakers or subwoofer designs the higher acoustical power creates significant pressure variations on circuit boards. This can expose two potential problems. First is mechanical resonances in the PCB which can either create buzzing noises or result in stress failure of soldered connections. Some components can be susceptible to mechanical stress causing a piezoelectric or piezoresistive (5) effects that in turn create distortion if the parts are in the signal path.

Crossovers and Amplifiers In an active speaker the system the crossover(s) can be optimized to match the properties of the drivers. The driver characteristics and the bandwidth of the filtered (i.e. band limited post cross over) signal can then be used to define the requirements of the amplifier portion. This comes down to three factors for the amplifier design:  Peak power (usually determined by the supply voltage and voice coil impedance4)  Average power (usually determined by thermal considerations5)  Signal to noise ratio Signal to noise ratio can come in to play for the tweeter, which can be very efficient in terms of acoustics power output and that the ear is quite sensitive to noise in the bandwidth that the tweeter typically covers. Amplifier distortion usually is a secondary factor as the speaker’s distortion will dominate, as well as any minimally competent design will have distortion products that are well below the audibility threshold in normal use cases. However good parts can be used in bad ways, so prototypes should be fully engineering verified and production systems have at least a minimal THD+N test to find assembly problems. Luckily active speaker systems have been around long before DSP was practical so there is a large body of available material to guide crossover design (6) and matching electro‐acoustical properties to amplifiers (7). Most high power (> 50W) class D amplifier designs have an analog input6. Some lower power designs offer a direct digital input in the form of I2S. There are a number of tradeoffs for applications using 25W/driver or less in deciding which type of input provides a system meeting the cost and performance targets.

Generic DSP processing flow for an active speaker Using DSP in an active speaker opens up a system to some very complex design architectures. In most cases a speaker is an open‐loop system, there is no feedback path like in normal electronic system design that reduces errors. A typical audio transducer operates only approximately linearly across a limited signal bandwidth and a limited power range. Distortion factors of a few percent when operating are typical. Luckily for most applications the nature of the distortion in a transducer is harmonically related to the fundamental frequency and the human ear can not detect the harmonic distortion. In some cases large amounts of distortion is actually preferred (for

4 Smaller drivers used in space constrained designs for mid bass frequencies can have low impedances; under 3 ohms is not uncommon. This means the amplifier might current limit before the supply rail causes voltage related clipping. 5 In a multi‐way speaker certain assumptions are usually made about the peak to average ratio and power spectrum of the signal source. For example tweeters generally need less power than . In a soundbar, with multiple channels in one enclosure, assumptions are made about not all channels needing the same peak and sustained power at the same time. A 3 channel soundbar (Left, Center, Right) might have six 50W amplifiers, with the power supply rated at 150W or less. 6 Most people think the “D” in class D stands for digital, but this isn’t true in the strict sense of amplifier classification. Historically audio has used class A or AB designs; class C being used for RF applications. A class D amplifier design is based on analog design techniques. (15)

5

example guitar amplifiers), but the general view on playback systems is that they should not introduce things that aren’t in the recording, even if it “sounds better” on playback with it added7. There have been some (rather expensive) speaker designs that incorporate feedback to reduce transducer errors; this is typically only practical for woofer (bass) drivers. Of interest now (8) is characterizing the driver more fully and then pre‐correcting the signal fed to the amplifier to counter act the driver’s non‐linear behaviors. There are limits to this as at high power levels the cone that is attached to the motor (voice coil and mount in a magnetic field) stops acting like fixed shape and breaks up in to a combination of mechanical resonances and with higher levels chaotic movement. Here we are just considering the DSP to correct frequency and/or phase error response errors to get better sound quality. We also seek to use the DSP to protect the speaker against damage from either thermal (i.e. high power) damage or mechanical noise and/or damage related to the voice coil traveling past its design limits. Clipping (limiter) Historically amplifier power was the limiting factor versus the speaker’s transducers for peak power. Driving an amplifier in to clipping creates a large amount of distortion and quickly becomes audible. Generally clipping occurs when the output voltage approaches the power rails. Clipping distortion consists of mostly odd harmonics and in a conventional speaker that means the tweeter sees more power than in the non‐clipping case and can lead to speaker failure.8 Those odd harmonics, when they become noticeable, tend create a harsher sound. When playing music, odd harmonics created by clipping from an instrument playing in the lower octaves are likely to be discordant with other instruments, furthering the undesirable sound.

FIGURE 3 ILLUSTRATION OF HARD AND SOFT CLIPPING In Figure 3 the dashed lines illustrate the maximum output voltage of the amplifier. With soft clipping levels above a certain value are reduced, typically by a power function. This reduces the levels of the harmonics and makes the distortion less noticeable. By using soft clipping the RMS level can be increased more than in a system that hard clips. While the playback sound no longer has the dynamics of the source content, the effect is subtle for moderate soft clipping and the system will play louder without the cost of more powerful amplifiers and transducers.

7 The tube versus transistor and the vinyl versus CD discussions are perfect examples of people preferring a “worse” system over a more accurate one. These days it’s easy enough with DSP technology to add in the distortions common to the older technologies, though people often prefer the real thing for non‐acoustic reasons. 8 In an electronically crossed over system the harmonics from the woofer amplifier clipping don’t end up in the tweeter, and typically the woofer can handle the extra power, though this is less true in today’s small, compact, sound bars and portable Bluetooth speakers.

6

In the Sigma DSP tools the soft clip function is used for this purpose, and implements an x3 power function for values over a user set threshold (the data range is ‐1 < x < 1). Since each amplifier is being fed a different signal from crossover output, the soft clip would normally be implemented on a per amplifier basis. Even if one amplifier soft clips the RMS level balance between the amplifiers remains the same. In some systems the amplifier may not be the limiting factor; the driver’s mechanical excursion limits may come in to play before the amplifier’s output clips. As mentioned previously some amplifiers, when connected to low impedance transducers (typically small “mid‐woofers”) may current limit at higher levels. Specific amplifier part behavior varies, some allow some level of over current for short periods but most generally implement some sort of foldback current limiting to protect against a shorted output9. The driver impedance varies with frequency so truly getting all available power out for a system where current limiting may come in to play involves splitting the clipping decision across multiple frequency bands. For most systems there is going to be little benefit to this. While the amplifier “cutting out” in an overcurrent situation maybe sounds like a good idea to let the user know they need to turn the volume down, most people would view it as a defect. Soft clipping with a red clip LED is a better solution. Dynamics Processor (compressor) The Sigma Studio dynamics processor blocks are a form of dynamic range compression that is applied across several waveform cycles and is primarily aimed at solving two system level problems: power rail voltage sag under heavy load and thermal protection of the driver. As limiting can also reduce clipping it can be used as an adjunct to soft clipping. A compressor with the time constants set to zero and a high compression factor will typically act like a hard clipper.

FIGURE 4 EXAMPLE OF A COMPRESSOR WITH A GAIN OF ‐3 ON RMS SIGNAL LEVEL. FROM (9)

9 In an active speaker this is not very likely versus a conventional audio system stand alone amplifier wired to passive speakers.

7

Sigma Studio offers a large number of compressors to choose from10, ranging from a simple hard limiter to a complex PeakRMS block that combines features of peak limiting with average RMS limiting. Choice of a specific function is dependent on the amplifier and drivers; there is no one‐size‐fits‐all solution. A peak compressor may be more desirable than the soft clipper in some systems. One decision to make is where to place the compressor on the signal chain, which can be summarized as either before or after the crossover. If placed before the crossover then the spectral balance of the signal is not changed by the compressor action. If placed after the crossover as two independent sections to maintain high RMS output from the system then the spectral balance is changed if the signal energy is concentrated in a specific frequency band. Since the system is being played at levels at the extremes of its design levels this error may be a reasonable tradeoff. Sigma Studio also includes 2 channel compressors and one can create schemes where the non overloaded channels is reduced during the overloaded channel’s compression period, but by a lesser amount. Again design intent as well as listening tests are needed to decide on a specific approach. The audibility of the compressor operation is also a function of content; what works for pop music may be objectionable for classical and not effective for movies or games. For the example being developed here we will assume two RMS limiters, one with a relatively fast set of time constants to reflect the limited peak power available from the (hypothetical) power supply, and per driver limiters with long time constants to reflect a simple approximation to the voice coil heating effects. Proposed signal chain Putting all of the elements together we obtain the signal path illustrated in Figure 5. On the assumption that there is a gain adjustment on the analog input the DSP should report the peak signal level back to the control microprocessor so that the user can be informed that the input may be clipping. Clipping at the ADC is hard clipping and should be avoided.

FIGURE 5 TYPICAL SPEAKER DSP PROCESSING CHAIN The first EQ block is generally used to flatten the overall response of the speaker and/or achieve a specific tonal balance. In small speakers this EQ stage may also include a high pass filter function to limit the amount of bass content in the signal; small speakers can’t reproduce the lower octaves and having them attempt to play them results in both the amplifier wasting power as well as creating large driver excursions that produce little sound. The first limiter has short time constants (typically 20‐60 msec) and is used to avoid exceeding the supply’s average maximum current capability11.

10 See https://wiki.analog.com/resources/tools‐software/sigmastudio/toolbox/dynamicsprocessorsresourcetable for a comprehensive table 11 The actual peak load design depends on many factors. With linear supplies and typical class AB amplifiers massive bulk capacitance and high VA rated transformers are needed for a no compromise design. With a modern

8

The crossover is typically a Linkwitz‐Riley design as it provides a flat system frequency response. It is worth mentioning that the tweeter has a natural roll‐off and better results may be achieved with different orders of low and high pass filters in the crossover. Also the effects of the filter’s phase response, combined with the transducer’s, should be considered to avoid a system that has good frequency response but bad (non‐linear) phase response. Digital filters can exhibit ringing (Gibb’s phenomenon) that aren’t possible in analog filters, though there is debate about audibility of this with real world signals. After the crossover the signal chain typically includes an EQ block for correcting any issues with the driver’s frequency and/or phase response, the goal being linear phase and flat response. In some cases driver EQ can be included with the first EQ that operates on the input. Most designs will correct the driver response individually and use the first EQ for correcting the overall system response assuming corrected driver channels as the total compute cycles needed is about the same and keeping them separate is less complex. A soft clip function is also included on the assumption that either the amplifier or transducer could experience a hard limit on signal peaks. The compressor will be discussed in more detail in the next subsection. In a typical speaker the tweeter’s radiating surface is a few inches in front of the woofer’s. A small fixed delay is added to the tweeter’s signal path to correct the phase difference that results from this. Sigma Studio offers an auto EQ and crossover tool as part of the standard offering (10) that automates some of the steps described here and should be considered as part of the design process. Transducer channel compressor The compressor with the long time constant is to model the thermal/heating effects. This is a very complex topic that is beyond the scope of this paper; google for estimation of speaker voice coil heating for a list of further materials. It’s worth pointing out that as the voice coil heats its resistance increases which means there will be less current flowing; this serves as a natural compression (acoustic output may drop by a dB or two in extreme cases) but excessive heating should be avoided as speaker lifetime can be compromised12. In some systems thermal issues will happen in the power supply or amplifier before they happen in the speaker. For systems with a microcontroller, placing a temperature sensor on the amplifier and power supply is a low cost option for protecting those sections. Some amplifier devices have built in thermal detection, though the goal might be to reduce output power13 so that the system continues to play at a lower level versus cutting out completely on its own. Modeling of power supply or amplifier heating is generally easy based on the RMS signal level. For transducers RMS power may not be a very good predictor for the long term temperature. RMS power can estimate a short term (i.e. over a few seconds) temperature increase that may be good enough for many applications. Full modeling of the transducer over long time periods and strategies for lowering volume are probably best done in the host microprocessor as the Sigma Studio tools could need a very complex block based design to handle the non‐linear aspects of the thermal estimation. If the compressor is reducing peak power without reducing RMS power then nothing is gained.

switching regulator and class D amplifiers the problem of limited peak power for short time periods is much more nuanced; with proper design the sustained power is most likely driven by thermal issues than supply limits as it’s typically a limited incremental cost for higher power supplies. 12 It is assumed the power supply will protect against shorts and/or amplifier failure – in an active speaker the considerations for protection are different than in a system that uses amplifiers and passive speakers. Regardless, it is possible for a speaker to catch on fire before the voice coil wire melts. 13 And inform the user with a LED or other indicator that it has overheated.

9

Some experimentation will be needed to test the transducers in the actual cabinet. Voice coil temperature can be measured from the resistance change of the coil; it is going to very difficult to directly instrument a voice coil for direct temperature measurement. The dynamics processor (compressor) blocks in Sigma Studio have a limited ranges of time constants. Most of the signal energy would be expected in the woofer; except for pathological full scale test tones it’s unlikely the tweeter will see the same power levels as the woofer. An undersized tweeter or smaller amplifier may be decided on for cost reasons; in this case the limiter on the tweeter signal path may be thought of as a protection device against these test signals. If the system includes a subwoofer then a significant amount of the amplifier power (and resultant voice coil heating) will happen there. In a compact stereo or soundbar system the design might consist of a single “low bass” woofer14, and a mid woofer and tweeter per channel. The crossover point between the low bass woofer and the mid woofer can be optimized for all of the factors discussed here as all of the sound will be emanating from the same enclosure so the psycho‐acoustic localization issues of a too high of a crossover with a separate subwoofer are mostly avoided15

Developing the speaker DSP application Using a Sigma DSP evaluation board and stock power amplifiers, many of the design aspects of the speaker code can be worked out using a prototype of the speaker transducers and enclosure. Using a pair of high quality speakers as a reference, the audibility of the compressors and clippers can be evaluated against the prototype system. For a new system it makes most sense to test out each major processing component individually so that cause and effect of parameter adjustments can be understood. It can be instructive to start with the clip and limiter blocks on full range signals. External waveform generators can be used to create known signals that provide easy determination of the block’s operation. Alternately Sigma Studio and a spare EVM output (there are 8 total) can be used to build up signal generators quickly. During development gain control and level display blocks are sprinkled through out the application to make level adjustments during design an easy process. Number formats The Sigma DSP parts use a signed 5.23 format for signals16, so numbers range from ‐16.0 to +16 – 1LSB. A value of 1.0 corresponds to 0 dB FS, so the peak signal is 24 dB relative to a FS value. This provides headroom during intermediate calculations, but be aware that some blocks (like the limiter/compressors) limit their outputs for a signal > 0 dB.

14 Calling it a subwoofer is probably a stretch. While there’s no hard cut definition of what a subwoofer is, a 4” driver in small shoe box sized cabinet is not going to get down to 20 Hz, which is generally where response for a full range system should go to. 15 It’s worthwhile to mention that since there’s the DSP available there are a number of tricks that can be played to change the perceived sound – for example at lower levels the bass woofer can be driven harder without distortion. Pscyho acoustic tricks like synthesizing bass harmonics can also change the perception for the better in these small speaker systems. In general it’s a tradeoff between accuracy and how loud it can play; the later criteria generally being the primary consideration in small speaker design. 16 5.19 for control values, and some blocks can be set for double precision (56 bit) internal operation.

10

The examples here are intended to illustrate concepts and not be fully checked for robust operation in all applications. Basic soft clip The diagram in Figure 6 is an example of testing a specific component. The second output allows easy comparison of the effect with the input reference as seen by the Sigma DSP board. This way distortion or noise components from the input signal can be accounted for17.

FIGURE 6 TEST DIAGRAM FOR SOFT CLIP In Figure 7 the source (red) and soft clipped output (green) is shown. The effect of the soft clipping does create some distortion products, but much less than hard clipping. The data capture displays are created with Visual Analyzer (11).

17 These examples were done using a USB sound card connected to a PC and not a precision measurement device like an Audio Precision system. This was done as a secondary goal of this paper, to use low cost (or free) tools as much as possible during initial development.

11

FIGURE 7 SOFT CLIP EXAMPLE (RED=IN, GREEN = OUT)

Basic compressor operation

This first compressor from Figure 5 acts on the signal prior to the crossover and would be used to limit the total power from the system; most likely because of limitations in the power supply. In a multichannel (i.e. soundbar) application it would look across all channels. It probably isn’t needed in a single channel speaker as most of the power is in the woofer and the design in Figure 5 includes limiters in each speaker channel. In this example, in addition to the input, the compressor block is fed a sinewave that alternates between two values so the effect of adjusting the block’s parameters can be observed. To test on just the input shut off the sine generator.

12

FIGURE 8 COMPRESSOR EXAMPLE WITH PULSED SINE SOURCE FOR TESTING

Figure 9 shows a capture of the sine wave test, showing the attack and decay times (the hold time is too small to be obvious here)18. The actual settings of this block in a system would be based on the limits of the amplifier and/or power supply to provide their maximum output before clipping for some amount of time. If there is no restriction from this then this block would not be used.

18 Unfortunately Visual Analyzer (11) has a bug that prevents stable display of long periods. A trial version of Soundcard Oscilloscope from https://www.zeitnitz.eu/scope_en was used, however it can not be recommended as it has (different) display problems with long time bases too.

13

FIGURE 9 COMPRESSOR EXAMPLE WITH SINE WAVE (RED=IN, GREEN = OUT) Transducer channel limiter The same limiter/compressor from Figure 8 can be used to limit power to the speaker to take in to account thermal issues for short term voice coil heating. As previously discussed long term thermal protection requires complex calculations that could be cumbersome to implement in Sigma Studio and can be better handled in the host microprocessor, again with the caveat that many systems won’t need this. It was observed but not confirmed with ADI that the limiter blocks have limited values of time constants for values > 1000 msec, and the largest possible value is around 8 seconds. The next two figures (Figure 10 and Figure 11) shows an example of the same type of two level pulsed sinewave as in Figure 9 but with a 50 second cycle to represent extended loud passages. These plots show the level of the signal on an arbitrary dB scale and were made using REW19. The effects of this block will be much more noticeable since it’s acting to limit the system to prevent damage. If each transducer’s signal path has its own limiter then the balance between the low and high frequencies will be off considerably while the limiter is operating. It is probably desirable to reduce all transducer channels by the same amount; this is them more or less the same as the single limiter prior to the crossover, except with a long time constant. This can be done by just daisy chaining limiters. Moving the long time constant limiter back to before the crossover may mean that the tweeter isn’t protected against very loud high frequency content. The soft clip function could serve that purpose if tweeter voice coil heating isn’t a concern. Again there is no one size fits all and this paper is only intended to show how Sigma Studio can be easily reconfigured to handle the many possibilities.

19 No one tool does all of the things one might want. REW is available from http://www.roomeqwizard.com/

14

FIGURE 10 INPUT SIGNAL LEVEL VERSUS TIME FOR TESTING LONG TIME CONSTANTS

FIGURE 11 LIMITER OUTPUT WITH TC = 4 SECONDS, THOLD‐2 SECS TO ILLUSTRATE POWER LIMITING FOR VOICE COIL HEATING

Crossover design One of the major advantages of using DSP in the speaker is the ability to create crossovers that are optimized for the system without the undesirable side effects from a passive crossover. The Sigma Studio crossover block probably handles most possible crossovers for 2 and 3 way systems, with 2nd through 6th order filters possible.

15

A simple test diagram allows checking the crossover against the actual speaker, as shown in Figure 12.

FIGURE 12 SIMPLE CROSSOVER TEST Crossover design is a complex subject and requires a series of compromises in almost all designs (12). For an introduction to the topic see chapter 5 in Newell (3). General goals are:  Reasonably flat frequency response across the transition region  Minimal phase/well behaved group delay20  Account for the physical driver separation and the non‐uniform radiation pattern that results21  Keep the transition regions away from either musically or psychoacoustically important frequency bands22  Have sharp enough cutoffs to make sure there’s little signal content outside of the driver’s operating frequency range Most crossover designs will use a 4th order Linkwitz‐Riley design as it offers a good set of tradeoffs. Final design

Combining the elements described in the previous sections results in the diagram shown in Figure 13. Some of the compressor blocks may not be needed depending on the amplifier and transducer characteristics.

20 Cue extensive debate about what, if any, difference phase shift makes to the actual listening experience with real content. 21 In the sense that the group delay can effectively steer peaks and nulls above or below the listening plane. 22 In most cases this is more a function of the transducers than the crossover.

16

FIGURE 13 FINAL SYSTEM FOR TESTING To ensure the system performs as needed it was used to drive a modified Dayton Audio B652 bookshelf speaker as an example of a real system, and one with many funny issues that wouldn’t occur with higher quality speaker drivers. But for $35 for a pair it works.

17

FIGURE 14 DAYTON AUDIO 6.5" BOOKSHELF SPEAKER The woofer and tweeter connections were modified to bring them out individually. The crossover in this unit is just a series capacitor with the tweeter, which was left in in case of an error during testing.23 REW (Room Eq Wizard) was used to create these plots, using a calibrated mic24. Initial tests were done in an office setting with the mic close to the drivers to maximize the direct signal. There are a large amount of reflections and room modes in this type of setup (as well as it can be loud for others) so this was useful only to validate that the system was working and the measurement system was acting as expected. Again the idea being to see what, if any, useful data can be obtained outside of a normal (rigorous) acoustic test. After validating the setup the system was moved to a lawn area outside, with the speaker on its back (i.e. infinite baffle, though it was not buried to be flush, acoustic foam was placed around it in hope of reducing edge effects from the cabinet). Mic was position 1m or 0.5m over the center of the speaker. Figure 15 shows the measurement of the woofer and tweeter responses. The notches at 200, 480, 3.4K, and above 15K Hz are measurement artifacts, i.e. they will change with different mic/speaker orientations. Figure 16 illustrates the effect of moving the measurement microphone; as can be seen the notches measure very differently25. The general goal with in‐speaker EQ is to fix the average response across wider bandwidths (typically 1/3rd octave).

23 At about $17 each it’s no great loss to fry one. However, there is the time to prep another one with separate driver connections to consider. 24 Dayton EMM‐6 SN 1164 using the supplied matching calibration file. 25 The notches come from destructive interference, i.e. a phase shift of a multiple of 180 degrees. Most likely these are from a wall about 8’ away from the measurement area. Use of anechoic chambers for test reduce this type of issue, but as long as it is recognized in less than ideal measurement circumstances we can see that we can develop a rough understanding of the system operation. It’s also possible to use gated measurements, PN sequences, and other techniques to mitigate reflection issues. Again this paper was seeking to stay cheap and simple as much as possible.

18

FIGURE 15 WOOFER AND TWEETER RAW RESPONSES

FIGURE 16 ILLUSTRATION ON THE EFFECT OF CHANGING THE MICROPHONE LOCATION ON THE WOOFER MEASUREMENT. RAW TRACE (LEFT), 1/6 OCTAVE SMOOTHING (RIGHT) The crossover frequency was set to 4 kHz as the woofer’s response drops off rapidly above that. The tweeter’s response isn’t great at 4 kHz but it does appear to be where there’s a knee in the curve from 12 dB/octave to 6 dB/octave.26 The EQ blocks in Figure 13 were adjusted to flatten out the response, Figure 17 shows the before and after results. Figure 20 shows the woofer parametric EQ settings used. These were determined by having REW play a white PN sequence27 and observing a real time FFT display, this allows instant visual feedback of the effects of adjusting the EQ settings.

26 Removing the tweeter’s capacitor would help here, but as explained earlier it was left in to prevent an ‘oops’ during initial testing. 27 In REW the FFT of the display is synchronized to then PN sequence, resulting in a stable display versus true random noise. A pink sequence does work better for the lower frequencies, but the 3 dB/octave tilt must be kept in mind.

19

While not all that flat the variation in its usable range of 60 Hz – 16 kHz has gone from +/‐ 10 dB to less than +/‐ 5 dB. Given the $17 price28 tag that’s not too bad. It also sounds quite a bit better, the uncorrected large bass peak made for a very tubby sound. Continuing with looking at what can be accomplished with desktop tools and a non‐test chamber environment, after completing the in office tests the speaker was moved to an outside area and placed on its back to produce Figure 18. The results are generally comparable; room modes should be gone as the only reflecting surface of importance was a single wall 8 feet away. To illustrate measurement artifacts the microphone was moved from 1m away to 0.5m away to produce the upper red trace in Figure 19. Notice what was a notch at 3.4 kHz is now a peak. Figure 20 shows the Sigma Studio EQ control panel for the EQ in the woofer chain. Assuming the goal is to get towards a flattened response the next step would be to do some blind ABX testing in a listening room to make sure the proposed EQ actually achieves the goal of sounding better29. With each iteration the sound should become more dialed in and the system evaluated under a range of listening conditions. Those familiar with speaker measurement know there are alternative ways to measure a speaker’s response with less impact from room effects. Standing wave patterns that lead to peaks and nulls only happen when signal from the speaker meets up with a reflected signal. If what the speaker is playing has changed in that time period then a standing wave pattern can not develop. Reflections can be eliminated from the time domain (calculated impulse) response by gating the measurement, though lower frequency and close reflecting surfaces could represent an issue. Most techniques use the fact that the impulse response can be transformed to/from the complete (amplitude and phase) frequency response via the Fourier and inverse Fourier operations. Speaker systems generally can’t play impulses accurately so alternate techniques are used to create them, usually by playing a MLS (Maximum Length Sequence) sequence or sine waves in some form. For a comparison of 4 different techniques, see (13). For a tutorial on swept sine (chirp measurement) see (14). There are a range of free and paid software tools available, the ones mentioned in this paper happen to be ones the author uses but there are other choices. There are differences in the goals of software for speaker measurement versus those that aim at circuit measurement and room measurement, and these tools reflect those differing needs.

28 At $17 retail that would put the estimated budget for the transducers somewhere around $2 for the woofer and $1 for the tweeter. You get what you pay for. 29 At the prototype stage different drivers might be evaluated as well. The pair in this speaker does seem like a curious combination as neither driver is working well near the crossover. But it is cheap.

20

FIGURE 17 RESPONSE BEFORE EQ (BLUE) AND AFTER (GREEN) MEASURED IN OFFICE (MIC AT 20 CM)

FIGURE 18 RESPONSE BEFORE EQ (BLUE) AND AFTER (RED) MEASURED OUTSIDE (MIC AT 1M)

21

FIGURE 19 COMPARING MIC LOCATION, 1M FROM PREVIOUS TEST (GREEN) AND 0.5M (RED) TO ILLUSTRATE MEASUREMENT ARTIFACTS

FIGURE 20 WOOFER EQ FROM EXAMPLE

ADI’s automatic EQ could also be used to flatten the response. Once EQ adjustment is done the levels for the compressor and soft clip would be set and then tested against the actual electronics (power supply and amplifier) and transducers to ensure they have minimal sound quality impact at high listening levels and still protect the

22

system from excessive distortion from hard clipping. If needed, the long time constant compressor for voice coil heating modeling can be used to protect against excessive temperatures. More complex thermal estimation and volume limiting is probably best done on the host microcontroller. This example used less than 10% of the DSP resources on the ADAU1452 EVM board operating at its default sample rate of 48 kHz, though only 9 bands of parametric EQ were used. This suggests that the ADAU17xx series part would be adequate for this application.

Summary

From the hardware perspective the Sigma DSP part is easy to design in to a system30. Sigma Studio offers a powerful set of easy to use DSP features for creation of audio applications and is well suited to the needs of active speaker design. Combining a speaker prototype with the EVM, amplifiers, and PC based analysis tools some very quick desktop prototyping can be done with minimal expense before moving in to a test chamber with full instrumentation. As was shown here the effect of non‐ideal (i.e. reflective) test environments for the system must be considered to avoid chasing non‐existent response problems.

30 Like anything else though easy is all relative. The first design for any part is never easy as all it takes is to overlook one piece of information and end up with non‐functional hardware.

23

References 1. Winer, Ethan. The Audio Expert. s.l. : Focal Press, 2013. ISBN 978‐0‐240‐82100‐9. 2. Everest, F. Alton and Pohlman, Ken C. Master Handbook of Acoustics 5th Edition. s.l. : McGraw Hill, 2009. ISBN 978‐0‐07‐160332‐4. 3. Newell, Philip and Holland, Keith. for Music Recording and Reproduction. s.l. : Focal Press, 2007. ISBN 0‐2405‐2014‐9. 4. Toole and E., Floyd. Sound Reproduction. s.l. : Focal Press, 2008. ISBN 978‐0‐240‐52009‐4. 5. Vishay. Mechanical Stress and Deformation of SMT Components. www.vishay.com. [Online] 8 15, 2015. Document Number: 28872. 6. Self, Douglas. The Design of Active Crossovers. s.l. : Focal Press, 2011. ISBN 978‐0‐24081738‐5. 7. Leach Jr., W. Marshall. Introduction to Electroacoustics and Audio Amplifier Design. s.l. : Kendall Hunt, 2010. ISBN 978‐0‐75775‐7286‐9. 8. SMART SPEAKER TECHNOLOGY. Klippel. [Online] [Cited: 5 12, 2106.] https://www.klippel.de/our‐ products/controlled‐sound.html. 9. lainf. Dynamic range compression. Wikipedia. [Online] [Cited: 5 12, 2015.] https://en.wikipedia.org/wiki/Dynamic_range_compression. 10. Automatic EQ, Crossover and Alignment of Speaker Systems. Miguel, Chavez and German, Ramos. Las Vegas NV : Presented at the ALMA Winter Symposium, 2011 January 4‐5th. 11. Visual Analyser Project ( current v. 2014 ). [Online] http://www.sillanumsoft.org/. 12. Martin, Geoff. It’s impossible to build a good . Part 1: Crossovers. earfluff and eyecandy. [Online] [Cited: 5 17, 2016.] http://www.tonmeister.ca/wordpress/2012/12/31/its‐impossible‐to‐build‐a‐good‐ loudspeaker‐part‐1‐crossovers/. 13. Stan, Guy‐Bart, Embrechts, Jean‐Jacques and Archambeau, Dominique. Comparison of different impulse response measurement techniques. s.l. : Sound and Image Department, University of Liege, 2002. 14. Chan, Ian H. Swept Sine Chirps for Measuring Impulse Response. s.l. : Stanford Research Systems, Inc. 15. Class‐D amplifier. Wikipedia. [Online] [Cited: 5 12, 2016.] https://en.wikipedia.org/wiki/Class‐D_amplifier.

24

Table of figures Figure 1 Major components of an active speaker system ...... 2 Figure 2 Sigma DSP controller board for an active speaker ...... 3 Figure 3 Illustration of hard and soft clipping ...... 6 Figure 4 Example of a compressor with a gain of ‐3 on RMS signal level. From (9) ...... 7 Figure 5 Typical speaker DSP processing chain ...... 8 Figure 6 Test diagram for soft clip ...... 11 Figure 7 Soft clip example (Red=In, Green = out) ...... 12 Figure 8 Compressor example with pulsed sine source for testing ...... 13 Figure 9 Compressor example with sine wave (red=IN, green = out) ...... 14 Figure 10 Input signal level versus time for testing long time constants ...... 15 Figure 11 Limiter output with Tc = 4 seconds, Thold‐2 secs to illustrate power limiting for voice coil heating ...... 15 Figure 12 Simple crossover test ...... 16 Figure 13 Final system for testing ...... 17 Figure 14 Dayton Audio 6.5" bookshelf speaker ...... 18 Figure 15 Woofer and tweeter raw responses ...... 19 Figure 16 Illustration on the effect of changing the microphone location on the woofer measurement. Raw trace (left), 1/6 octave smoothing (right) ...... 19 Figure 17 Response before EQ (blue) and after (green) measured in office (mic at 20 cm) ...... 21 Figure 18 Response before EQ (blue) and after (red) measured outside (mic at 1m)...... 21 Figure 19 Comparing mic location, 1m from previous test (green) and 0.5m (red) to illustrate measurement artifacts ...... 22 Figure 20 Woofer EQ from example ...... 22

25