11. Case study #3: A line array with DSP

As many DIY’ers can appreciate, sometimes a major project starts with an irresistible sale.  All Electronics had some OEM FPS tweeters on sale for $1 each–and they are similar to the version that usually sells for over $20.  They also had 2″ Boston Acoustics woofers for $1.75 each.  So this project started about 4 years ago, when I received 3 boxes of drivers from All Electronics.

Line arrays have generated a lot of interest in recent years because of their interesting radiation characteristics, their efficiency and their low distortion due to each driver operating with limited excursion.  And more recently, researchers such as Keele have been advocating the curved array that implements a Constant Beamwidth Transducer, or CBT.  Keele has also provided the math models that characterize that design, so we have a good starting point for evaluating their performance.  The CBT design has a radiation pattern that is independent of frequency and a polar radiation pattern that is independent of distance, and these two factors result in more coherent stereo imaging.  The line array and CBT technologies are certainly worthy of more experimentation, so this study started with a large stash of drivers and a strong desire to explore the line array and CBT technologies.

The primary goal of this study was to investigate whether it makes sense to build an active line array, and how the DSP software described on this web site could be adapted to this type of speaker.  So I wanted to build a very flexible and easily programmed test bed for an active line array speaker, where I would be able to provide electronic control of the array “curvature” and shading.  I also wanted to easily change the crossover frequency and slopes.  Unfortunately, this a very complicated and tedious project, as the design goals required many channels of DSP for each speaker, lots of low-power amplifiers, and a significant amount of woodworking.  Along with the DSP and amplifiers, there is a considerable amount of software involved to control the DSP and provide a high-level user interface.  This write-up addresses the project phases as 6 major thrusts:

  1. Design goals and key decisions
  2. DSP/amplifier board design
  3. Enclosure design and construction
  4. Algorithms
  5. Software
  6. The base (with subwoofer)

Design Goals and Decisions

The primary goal was to provide multiple channels of delay to achieve the same effect as using a curved baffle.  Keele discusses this approach in the 2002 AES paper titled “Implementation of Straight-Line and Flat-Panel Constant Beamwidth Transducer (CBT) Loudspeaker Arrays Using Signal Delays”, but notes that this approach has significant complexity.  When that paper was written, the amount of circuitry required to implement the many channels of delays was prohibitively expensive, and as a result Keele’s paper only provides results of simulations rather than measurements of an implemented system.  But the introduction of DSP processors such as the ADAU1701 has dramatically lowered the implementation cost for multiple channels of delay, as a single $10 ADAU1701 chip can provide programmable delay for the equivalent of several feet of delay for 8 channels of audio.

As noted in the introduction, the project made an early commitment to the 1″ FPS flat panel tweeters and 2″woofers, although the woofer selection wasn’t “cast in stone”.  Some of the early sketches showed that the project would require about 100 tweeters and 30 to 60 woofers.  Even though I had those 2″ woofers, I wasn’t too excited about all of the woodworking, mounting hardware and wiring required for smaller drivers.  Those 2″ woofers have a small basket without any mounting holes, and that mounting problem had me worried.  Also, the 2″ drivers probably meant that a subwoofer was needed.  However, I never found a larger driver that was reasonably low-cost, and I didn’t like the idea of a larger enclosure that would be needed for larger woofers.  So, after considering the tradeoffs, I decided to go ahead with the 2″ drivers.

It was desirable to implement a fairly large array, on the order of 5 to 6 feet tall, with symmetry about the center point, and it was desirable to keep the high frequency drivers very small to minimize comb filter effects, particularly for off-axis listening.  In order to keep the delays less than one half wavelength for maximum delay, the tweeters were grouped into “zones” that were mirrored about the center point.  Each of the FPS tweeters was 1-3/8″, and they were grouped into pairs, wired in series with each other.  The tweeter pairs were wired in parallel with their corresponding pair across the midpoint of the array to create a zone.  The woofers were wired in similar fashion, but since these drivers would not have high frequency output, fewer zones were needed for the woofers.  The figure below depicts the tweeter pairs and woofer pairs.  Tweeter pair T13 was paralleled with T12, T14 was wired in parallel with  T11, and so forth.  This resulted in an array that was 66″ tall and had 12 unique tweeter zones and 8 unique woofer zones.  Each zone requires a unique delay and shading value, so this design required 20 channels of DSP, each with delay, volume control, and filters for implementing the active crossover.

Given the complexity of the circuitry and the desire to control the DSP remotely, the DSP/amplifier board was started first, even before there was a plan for the enclosure and how the drivers would be mounted.  I figured that if I could make the board, the rest would follow…someday.

DSP/amplifier board design

The ADAU1701 has an 8-channel architecture, so 20 channels plus one or two more for a subwoofer means I needed 3 ADAU1701 chips.  So each board has 3 ADAU1701 chips and 20 power amplifiers.  The individual amplifiers didn’t need to be very powerful, as there are a total of 40 amplifiers for a stereo configuration, plus a pair of external subwoofer amplifiers.

The on-board power amps use a combination of SSM3302 chips plus SSM2518 devices.  The SSM2518 chips are powered from a 5V supply and provide about 2W of power per channel.  They feature an I2S digital input that provides a simple connection to the ADAU1701 serial outputs, and the distortion is very low.  Analog Devices has an app note showing how to use these devices for a TV sound bar, so they looked like a good choice.  They looked like a good match for the FPS tweeters, which are only rated at 2W RMS power.

The SSM3302 chips have plenty of power for the woofers, at about 15W from each device, and a total of 7 of these chips were used per board (there is a “spare” that can be used if one of the channels fails beyond repair).  The SSM3302 uses a spread-spectrum technique to ensure that the power drawn by these class D amps is not synchronized to a single clock, so that the chips do not “interfere” with each other, as sometimes happens with multiple class D amplifiers on a single board.  It is possible to use the SSM3302 without an output filter and still have acceptable RFI/EMI radiation, but given the length of wiring expected for this array, the design uses common mode inductors on the outputs of each of the SSM3302 chips.

The allocation of the DSP and amplifiers to the logical speakers, or “zones”, is shown in the next diagram.  As indicated, there is also a serial output from the ADAU1701 to a DAC that provides two channels of analog output for a self-powered subwoofer.

An interesting feature of the original design is the SPDIF interface.  Since I wanted to be able to control all of the delay blocks and volume blocks in the ADAU1701, I needed some way to send commands to the microprocessor that controls the DSP chips.  It turns out that the SPDIF standard provides two user bits for each block of audio data, and these bits can be used to send messages at reasonable data rates.  I wrote the code to implement this messaging, and the plan was to connect these speakers to a stereo preamp that could buffer the messages and send the commands along with the digital audio.  However, after building that preamp, the commercial WiFi audio technology had matured to the point where SPDIF connections and SPDIF messaging are no longer attractive solutions.  So this SPDIF messaging ended up being a diversion that will not get used in the final design.  That obsolescence happens when you have technology projects that last for more than 3 years 🙁 .

PCB Design

I’ve been using DesignSpark for a while now, and I’ve got a number of proven circuits and layouts that I was able to copy and paste into this design.  It’s a complicated board but lots of repetition.  And even though there are quite a few parts, the board assembly went well, with no problems like unsoldered pins or incorrect parts.

However, there were some errors in the design, like not grounding pin 30 of the ADAU1701 (who knew…?) and forgetting to AC-couple the analog outputs of the ADAU1701.  And an incorrect PCB library part for the 1.8V regulator had me stumped for a bit during initial debug.  So these first-generation boards have some jumpers…but nothing that required completely scraping the boards.

These boards were actually designed in June of 2015, back when I was still using assembly code for the Motorola S09-series microprocessors.  But in the last few years I’ve been using the Arduino-compatible devices, so I removed the micro that was on the board and connected a teensy3.2 board to the I2C lines for controlling the micro.  The teensy32 board uses a Cortex M4 processor with enough floating point horsepower to calculate the biquad coefficients in real time, and it also has 256K of flash memory for storing multiple versions of the DSP code.  That’s a powerful combination that is useful for this design.  The teensy board is attached to the back of the main board with Velcro strips.  There is also a Bluetooth UART module on the back of the board, and that is how commands are received from the cell phone application.

Another development in recent years that impacted this design is the emergence of low-cost multi-room WiFi adapters for streaming audio from Internet radio sources or from local music libraries.  My board already had an SRC chip (SRC4382) for receiving digital audio, but I hadn’t provided a TOSLINK connector.  So I added the TOSLINK connector with hot melt glue to keep it in place, and worked through the programming to convert the 44.1KHz audio from the WFA28 WiFi adapter to the 48KHz audio that I needed for the DSP’s and subwoofer DAC.

So after debugging all of those hardware issues and getting some basic software to program the DSP’s and the SRC… it worked!.  All 22 channels have output (20 power amps per board plus two subwoofer outputs), and both amps are working.  The amp board is mounted to an aluminum plate using aluminum standoffs.  Each of the mounting holes has a thermal connection to a nearby amplifier chip, so all of the SSM3302 chips transfer heat to the mounting plate.  I don’t have a close-up of the amp board mounted on the plate, but this approach works well:  the plate gets warm but not hot to the touch, and all of the amp chips feel just slightly warm.

Enclosure design and construction

Believe it or not, the enclosure started out looking like this about 6 years ago:

Our cabin neighbor in Oakland, MD had acquired some cherry and maple trees that he was going to use in his boiler.  I convinced him to take some of the logs to a local mill, and ended up with over 600 board feet of wood that cost us about 40 cents a board foot to have milled.  We then dried the planks for 2 years inside our cabin.  The cherry is beautiful, with lots of figure.  With the right finish, it has remarkable chatoyancy with patterns of light and dark that shift as you move the light source.  This is my fourth speaker project using that wood.

The enclosure didn’t follow any plans or drawings–it was one of those projects where I just kept cutting and fitting until I was OK with the overall size and shape.  However, there was a lot of careful measuring and marking for the driver openings.  You don’t want to drill this many holes without plenty of good beer available.

 

Algorithms

Algorithms??  Yep–there’s a lot of math involved in line array design, and you just can’t start writing software for this design without doing the math.  The algorithms addressed in this article are for the delays and volume shading for each driver “zone”.  There are also many calculations involved in the crossover, equalization and bass boost capabilities, but those calculations are discussed in other articles on this website.

The goal was to provide variable curvature that implements a constant beamwidth transducer, by using electronic delay rather than a curved baffle.  Following the example of Keele, we select a cap angle of 120 degrees for the case of maximum curvature, and calculate the X and Y coordinates for each of the zones in the array.  The zones are at equal spacing, and there are a total of 24 tweeter zones and 16 woofer zones,  with symmetry about the center point of the array.  The X coordinate value of each zone is subtracted from the X coordinate of the zone in the center to determine the amount of delay required for each zone.  A spreadsheet for these calculations computes the delay in inches, and then converts that length into the number of clock samples of delay needed for the DSP.  The maximum amount of delay for the 120 degree arc is 18 inches, which requires 64 clock cycles of delay for the ADAU1701 using a 48KHz sample rate.

There are 5 intermediate curvature values, which are calculated using arc lengths of 120 degrees, 100 degrees, 80 degrees, 50 degrees and 0 degrees (no curvature).  For concave values of curvature, the same delay values are used, but the “reference points” where there is zero delay are the zones on the top and bottom of the array rather than the center.

Keele provides a detailed account of the shading algorithm needed for the CBT, which uses a Legendre function, which is one of the so-called “spherical harmonic” functions.  Fortunately, Keele provides a 3rd order series approximation that we can use to calculate the volume levels for each of our zones.  Again, I used a spreadsheet to calculate the volume levels required for each zone, using cap angles of 120, 100, 80, 50 and 0 degrees.  The volume weights range from about -13dB for the cap angle of 120 degrees to 0dB for the zones in the center of the array.

By pre-calculating the delay and shading values, the processor can simply look up these values from tables rather than performing the calculations in real time.  Using tables with a fixed number of options is less flexible than having the micro calculate the delay and shading, but it is so much easier to check the results using Excel, so this is good place to use pre-calculated values.

Software

It turns out that most of code from the stereo 3-way DSP board described elsewhere on this site could be easily modified to control this board.  The biggest challenge was that the processing cells were spread across 3 ADAU1701 chips, so I had to generate tables that mapped the processing cells to the drivers.  These tables were generated by manually following the wiring diagram for the line array, to match the 20 zones to the cells created by SigmaStudio.  Every routine that updated a capability exposed in the user interface needed to be revised to use these tables for updating the hardware.  Those updates were time-consuming but not overly difficult.

The shading required adding another set of volume controls to the SigmaStudio design that is described in the Article #4, but otherwise the SigmaStudio design was basically the same as shown in that article.  Each ADAU1701 chip on the board gets the same SigmaStudio code.

The biggest new software challenge was coming up with a good way to control the curvature.  It turns out that App Inventor has some easy-to-use drawing features that led to a nice user interface for the curvature and shading routines.  The embedded video below shows the solution:

The cell phone cartoon is half the resolution of the actual line array, as there are 12 mirrored tweeter zones and 8 mirrored woofer zones in the line array.  The cell phone app just shows 6 balls, mirrored vertically, for a total of 12 balls.  I made the app simpler than the actual line array because there is a lot of X, Y, and radius info that gets typed into tables, and it’s no fun creating and typing all of this data into App Inventor.

Channel 21

It became clear during initial testing that even with aggressive EQ, the bass output wasn’t going to be adequate.  And, of course, I needed something to keep these things vertical.  So, I started thinking about how to add a subwoofer to each side, where the subwoofer would double as the stand.  I had planned ahead by providing two subwoofer outputs on each board, and the software and cell phone GUI were already set up for a 3-way design, so adding the subwoofer software was going to be easy.  Since there are 8 channels for the 2″ woofers and 12 channels for the tweeters, this subproject became known as “Channel 21”.

The front panels of the arrays extend beyond the rest of the cabinet about 4″, as shown in the picture below.  This “tang” was provided for mounting, but I never came up with a detailed plan for attaching the tang to a stand.  I had made a “quick and dirty” stand out of 2″ by 6″ lumber (see the picture) to better understand what I needed to mount the arrays, and got a feel for how stable the arrays would be just clamping the front panel into a slot.  It was clear that I needed a secure clamp or else some additional supports on either side of the array to make sure the arrays wouldn’t fall over.

Some additional requirements were that I wanted to isolate the arrays from the subwoofer cabinet vibrations, and I wanted to make the arrays easy to dismantle and move around.  I wanted quick disconnects for both the electronics and the mounting brackets.  And finally, I wanted to use up a pair of Peerless XLS 830500 woofers and some old plate amps that had been stored in my attic for over ten years.

The Channel 21 solution is shown in the picture below.  It’s really just a plywood 2 cu ft box with a sealed slot for inserting the line array tang.  It’s got a panel for switching the AC, routing the power to the amplifiers and routing audio to the plate amp.  That panel is also a mounting plate for a 100W switching power supply for the amplifier board.

There is a “pocket” on the top of the box for accepting the tang from the front panel which is lined with heavy foam cut from sheets of exercise mats (EVA foam).  It’s a tight fit and getting the tang into the pocket requires a heavy layer of auto wax to lubricate the pocket.  But once the tang is inserted, the line array is held snuggly.  I added cherry “wings” to either side of the array that are attached using shock-isolated bolts with rubber grommets.  The wings just rest on top of the plywood box, so the array can be lifted from the box in a matter of minutes.  Not shown in the picture is a small wood panel on the back of the wings to protect the amplifier board and to make it easier to transport the array without damage.

 

As already noted, you can disconnect those two connectors, and then remove the array by gently rocking the structure back and forth while lifting up.  There are no screws or other hardware.  The array is a bit heavy, but one person can lift it out.

The Assembled Line Arrays and Initial Testing

Yes, it’s alive.  The software is still clumsy, in that my cell phone app only connects to one speaker at a time, so if you want to change the volume for both arrays it takes some extra work.  Also, occasionally the Bluetooth communications drops a character or has some other error (still investigating this), and you need to reload the software to regain control.  And there are still some functions that aren’t completed, such as the polarity selection for the crossovers.  But those things will get fixed.

Most importantly…how do these sound?  Well, they sound good enough that my wife didn’t try to neuter me when she saw them in the living room in our cabin.  That’s a good sign.  But what probably kept her from reaching for the knife was the WiFi.  She can sit at her computer in the kitchen area and select music on Spotify.  Because of the way these arrays fill up the room, she can listen in the kitchen some 30 feet away.

Line arrays in general have a way of filling up a large room that feels “natural”, and these arrays are no different.  When used in CBT mode, with a convex curvature and volume shading, they tend to “disappear” in the room, and the stereo imaging is excellent.  The imaging and overall engaging sound is incredible–CBT line arrays are worth the cost and effort.  The speakers have a much more “dynamic” sound than others I have heard, in that there is a huge range between loud and soft, and even at high volumes these speakers don’t seem strained at all.  I still need to spend time measuring these and getting the EQ and volume levels correct, but even in this “thrown together” state they are very impressive.  I usually use choral music to test speakers for clarity, and these speakers do very well on that type of music–voices are clear and distinct, with effortless dynamic range.

There is still a lot of software tweaking and refinement to call these finished, but I’m declaring a victory for now, even without being 100% done.  This study met all of the objectives, by establishing that even a line array can be made as an active speaker, and that lots of small amplifiers with lots of small speakers with lots of DSP can be a potent, high quality audio solution.  And, although some of this might be in the “extreme DIY” category, it can be done by individuals using common shop tools and at a very reasonable cost.

I’ve still expecting many hours of refinement and tweaking and evaluation, but those efforts will take a back seat to other projects, at least for a while.  This was a great learning experience and I’m happy with how these turned out.  But this was also a lot of tedious detail work, and I’m not itching to build another set :).