Prototype VI - First Tri-amping

Prototype VI is Tri-amping!

Jon and I were able to get a prototype VI system (pictured below) to tri-amp this evening. I removed the crossover from my speaker cabinet and internally connected the speaker cabinet terminals directly to the speaker terminals. I then ran three pairs of speaker wire from the four amplifier channels of my amplifier to the speaker terminals. One pair for the tweeter (channel 1). One pair for the mid-range (channel 2) and one pair for the woofer (channels 3 & 4). The woofer is driven by two amplifiers configured as bridged tied load (where one amplifier drives one terminal of the speaker 180 degrees out of phase from another amplifier that drives the other speaker terminal -- thus doubling the voltage across the speaker and quadrupling the power).

Jon has previously written an ALSA driver for the MPC5200. The advantage of using an ALSA driver for our amplifier is that once done, you can use many standard playback tools to play music on the system. We currently use 'aplay' to play tones/music and 'alsamixer' to control the volume. We do the following to play a WAV file:

aplay some_wave_file.wav

However, 'aplay' alone does not know how to implement a digital crossover. For that, we use a tool called BruteFIR. This is a convolution engine that knows how to accept PCM input, send it through any number of filters and then pipe the output to ALSA devices. So, the combination of BruteFIR and an ALSA driver for our amplifier allows us to *finally* tri-amp my speakers. To tri-amp a 440Hz tone, we do the following command:

brutefir triamp.txt <tone_l440_r000.wav

This command requires a little explanation. First of all, the 'tone_l440_r000.wav' indicates a continuous 30 second wave file with a 440Hz sine wave on the left channel and silence (0Hz, no amplitude) on the right channel. Why silence on the right channel? Because DigiSpeaker is a *mono* system. That is, each DigiSpeaker is designed to only play a single channel of a stereo signal (either the left or the right, but not both). In this case, I am sending the left stereo signal through the amplifier. A pair of DigiSpeakers is required to play a stereo signal.

To send the left channel signal through DigiSpeaker, BruteFIR requires a configuration file. In the above command, the configuration file is called triamp.txt. Refer to the BruteFIR documentation for a full explanation of this file. However, as a brief tour, notice that this configuration file is for music sampled at 44100Hz and that the filters used to process the music are 2048 (256 x 8) taps long. The filter coefficients are called 'ctweeter', 'cmidrange' and 'cwoofer'. Those coefficients are used by filters 'ftweeter', 'fmidrange', 'fwoofer' and 'fnotused'. Those filters accept input from a 'front-end filter' called 'fdrc' which will eventually be digital room correction filter (just a copy filter for now). The 'fdrc' filter accepts its input from standard-in and the output of the four channel filters ('ftweeter', 'fmidrange', 'fwoofer' and 'fnotused') are send to two dual channel ALSA devices (hw: 0,0 and hw: 0,1). The output of the tweeter and woofer filters are attenuated (6dB and 7dB respectively) to compensate for the fact that the mid-range speaker is lower SPL. The magnitude of the output of the 'fnotused' filter is inverted to create the inverted woofer signal used in the BTL configuration of the output. The magnitude frequency plots for the three filters are shown below and the coefficients are attached for those that want to experiment. The filters were generated by ScopeFIR, an excellent and easy to use tool from Iowegain International.

So far, so good.

Now, to actually play an MP3 on Digispeaker, we need to use a tool that decodes an MP3 file into a WAV file (or stream) and pipe that result to BruteFIR. We use 'madplay' which is a common command line oriented MP3 decoder that is not too big. Here is the command to play an MP3 file on DigiSpeaker:

madplay --output=wave:/dev/stdout some_mp3_file.mp3 | brutefir triamp.txt

Finally, Jon and I thought it would be fun to try and play an internet radio station on DigiSpeaker before we declared victory. So, I picked Radio Paradise. My DigiSpeaker doesn't know URLs yet so I had to use real addresses. However, here is the command:

wget http://207.200.96.136:80/stream/1048 -O /dev/stdout | madplay --output=wave:/dev/stdout /dev/stdin | brutefir triamp.txt

This will continuously get an MP3 stream from Radio Paradise (207.200.96.136) and send it to standard out. That output is piped to madplay which decodes it and sends it along to BruteFIR. BruteFIR splits the left channel of the stream into four separate channels and sends them to the amplifer which drives the speaker.

Filter Magnitude Response Plots

Lowpass Filter Frequency Response

Sample Frequency: 44100Hz
FIR Filter Taps: 2048
Passband: 150Hz
Stopband: 250Hz
Ripple: <0.25dB
Attenuation: Below -80dB
Phase Response: Linear
Coefficients: click here

Bandpass Filter Frequency Response

Sample Frequency: 44100Hz
FIR FIlter Taps: 2048
Passband (top): 1750Hz
Passband (bottom): 1950Hz
Ripple: <0.25dB
Attenuation: Below -80dB
Phase Response: Linear
Coefficients: click here

Highpass Filter Frequency Response

Sample Frequency: 44100Hz
FIR Filter Taps: 2047 + 1
Upper Stopband: 2000Hz
Lower Passband: 2100Hz
Ripple: <0.25dB
Attenuation: Below -80dB
Phase Response: Linear
Coefficients: click here