SigmaStudio Tutorial Part 5.

The previous post was an example of how to use the DSP as an active crossover. It assumed the DSP to be part of an audio chain like this:

The major role of the preamp is usually to add some gain to the source, act as a source selector, a volume control and enable filters like tone controls, loudness etc. The added gain might be a problem since the DSP only got an input sensitivity of max 1.1 Vrms. One solution is to attenuate each source to limit the output through the preamp and always keep it less than 1.1 Vrms (some preamp got gain settings that might be used). But apart from the source selection pretty much everything else the preamp can do the DSP can do, sometime even better. So lets take a look at the pros and cons of using the DSP as preamp.

The first thing that comes to mind is filtering. As a preamp the DSP work on line level so it can do pretty much any filtering even on passive speakers. You can use it as a PEQ for speaker or room corrections or as a Linkwitz transform. It can also be used for traditional filters like tone controls, the possibilities are endless. But it is not limited to static filtering, it can do dynamic filtering too, like dynamic bass boost and variable loudness etc. And it can still act as an active crossover if used for active speakers. So its pretty obvious it can replace a preamp from a filters point of view.

Another capability of the DSP is general-purpose input/output (GPIO) pins and auxiliary ADCs. It can be used to interface and control the DSP and to replace a lot of low level internal wiring carrying audio signals. If the wires from the input switch and to the power amp is kept short this is pretty much all that is carrying an audio signal. The rest can be done in the DSP core. Take volume control as an example. There are four analog outputs, implementing a traditional volume control would require a logaritmic four-gang potentiometer or stepped attenuator. The potentiometer would be hard to find, it would be far from logarithmic and it would not track 100% between channels. Implementing it through the DSP would require a bog standard 10k single gang liniar potentiometer interfaced through one of the ADCs. It can be programmed to any taper and it will track 100% between channels. There are drawbacks with a digital volume control but it has to be weight against the ones that come with the analog alternative. If an analog volume control is to be used then the best position in the audio chain would probably be after the DSP DACs. So to me it makes more sense to replace the preamp in the use case above and use the DSP as the preamp if only to get the volume control right (or less wrong).

The major problem is that the Volume Control blocks in SigmaStudio is not logarithmic and therefor far from usable as volume controls in a preamp. But the power of the DSP is that it can be programmed to do almost anything so lets make a logarithmic volume control driven by an an analog potentiometer. Open SigmaStudio, use the previous example and add a new Hierarchy Board from the Systems ToolBox and name it Volume Control. Also add the required Hierarchy Input and Output blocks from the Systems ToolBox (I use 4x of each for this example). Switch to the new Volume Control board and add the following blocks to the board:
  • 1x Auxiliary ADC Input from the IO ToolBox
  • 1x DC Input Entry from the Sources ToolBox
  • 2x Multiply from the Basic DSP ToolBox
  • 1x Signal Add from the Basic DSP ToolBox
  • 2x Index Lookup Table from the Level Detectors/Lookup Tables ToolBox
  • 1x Single slew ext vol from the Volume Controls ToolBox
Right-click the volume control block -> Grow Algorithm -> Ext vol (SW slew) -> 3. You now got a four channel volume control that accepts external control. You now need to hook everything up like this (I have used Alias instead of T Connections because its a bit more flexible):


Press the GUI button on the Index Lookup Tables and enter the values in the picture above, or cut and paste from the table below.

Table Row

Slope LUT

Step LUT

1

0.0401

0.001

2

0.0912

-0.00411

3

0.1749

-0.02085

4

0.2461

-0.04221

5

0.4377

-0.11885

6

0.5849

-0.19245

7

0.927

-0.39771

8

1.4692

-0.77725

9

2.3285

-1.46469

10

3.6904

-2.6904

11

5.8489

-4.8489


Its a lot to take in but I will try to explain whats going on. The Auxiliary ADC Input is set to AUX_ADC_2 in this example because it is the one used by the 3e Audio DSP volume pot by default (change it to whatever ADC you use for your potentiometer, and make sure its configured and enabled on the Hardware Configuration tab, IC 1 - 170x/140x Register Control section, in SigmaStudio). I named the output from this block Volume Pot and it is in another format than the Lookup Tables expect as an input. I therefor need to multiply this value with 10 so I use the DC Input Entry as the static value 10 and I multiply the ADC value with it using  a Multiply block. The output named Index is now accepted by Index Lookup Table block as input. This index value is fed to both tables named Slope LUT and Step LUT. The output from the Slope LUT in multiplied with the Volume Pot value using another Multiply block before it is added with the output from the Step LUT using a Signal Add block. The result is called Log and represents a value from the potentiometer following a logarithmic taper and that is accepted as input to the  Single slew ext vol block. Does is look like a lot? Is it worth it? Well the response will go from this:

To this:
So I would say its not only worth it, its a must if the DSP is supposed to be used as a preamp. I personally find the taper in this example being a nice compromise between being true log with a useful attenuation. The taper can be adjusted by changing the values in the two lookup tables

Note that I made the volume control four channels. Its perfect if its going to be used in combination with a crossover filter at the end of the audio chain, like this:

But this solution works just as well with any number of channels and the channel tracking will be 100% perfect and it will only require a single gang potentiometer no matter the amount of channels.

Now some food for thoughts. Lets replace the preamp with the DSP in our audio chain:


What we implemented with this SigmaStudio project currently represents something like this:


Combine it with an input switch and power supply and you get something like this:


Add a couple of power amps and you get a nice four channel integrated with programmable speaker EQ and XO built in:


But it doesn't have to be a four channel driving active speakers. If used as a two channel we would have another pair of channels that can be used as an extra output, a passthrough or to feed a headphone amp. You then have the opportunity to implement cool things like a PEQ or active crossfeed on your headphones. It can take the form of a two channel preamp:


Or a two channel integrated:


The input switch could be as simple as a (break before make) rotary switch (e.g. wired like this) or something a bit more fancy like a relay driven switch board with some clever input logics. It can also be a good idea to incorporate trim pots or resistors as voltage dividers on the inputs to level match the sources with the input sensitivity of the DSP.

This is just a couple of basic ideas how a DSP can be incorporated as a preamp or as a part of an integrated. Being able to program the DSP in order to tune it to any speaker, room or audio preferences is powerful enough. Combine it with the use of GPIO in order to add logics, control filters, switch audio etc. makes the DSP not only powerful but extremely flexible. There are drawbacks off course like extra AD/DA conversions for analog sources, limited bit depth for software volume controls etc. But I have a hard time seeing myself giving up on everything the DSP has to offer as long as the drawbacks are more or less inaudible. This might not be the case if you got the hearing of a dolphin but the DSP technology will evolve, it will get cheaper and better and finally measure up to the most demanding HiFi requirements, at least on paper. For some it will never be enough but for me its already good enough.