DIY ProLogic II

I am not using a receiver for my home theater. My source is a personal computer and it's output goes to a four channel amp. (Not a receiver.)

If any of you are in a similar boat, and you're interested in doing some Dolby ProLogic II type stuff, here's how.

OK, first off, what is ProLogic II?

The short answer is that ProLogic II is a decoding scheme that takes a stereo signal and turns it into six channels. There were some later iterations that can turn it into eight channels and there's really nothing stopping you from turning it into a hundred channels. The only limit is your amp channels and your sound card channels.

1204fos.1.jpg

Stereophile did an excellent interview with Jim Fosgate (of Rockford Fosgate) about his ProLogic II decoder and it's history : https://www.stereophile.com/interviews/1204fosgate/

attachment.php


ProLogic II uses a matrix to do the decoding. The pic above is that matrix. Dolby has published their spec and this is it. Let me translate the pic into English:

1) We take the left channel of the source and feed it to the left channel of the output
2) We take the right channel of the source and feed it to the right channel of the output
3) We take .707% of the left channel and .707% of the right channel, combine them, and feed them to the center channel of the output. (Note that this means the center channel is louder than both the left and the right channels.)
4) We take .87% of the left channel, invert it, and combine it with .49% of the right channel, and feed that to the left surround channel
5) We take .87% of the right channel, invert it, and combine it with .49% of the left channel, and feed that to the right surround channel
 
The easiest way to do ProLogic II is to do it with the three front speakers.
No processing is required. Just combine the left and the right channel, feed them to a dedicated amplifier, and adjust the center speaker so that it receives 41.4% more power than the left and the right speakers.
 
The next easiest way is with a MiniDSP.
You need the "2x4 ADV" plugin.

This plugin is intended for people that want to do sub-satellite setups. IE, you can combine a stereo input to produce a mono output, for a sub.

But there's nothing stopping you from using this plugin for Dolby ProLogic II.

Just go to the 'routing' tab of the plugin, and create a mono output. This mono output will correspond to your center channel. Then use the 'delay/gain/rms' tab to adjust the output of the center so that the output is 41% higher than the left and the right.

To produce the rear channels you'll need another miniDSP because four outputs isn't sufficient.

Note that the plugin doesn't offer a way to invert the inputs, so I think you'd literally have to make a cable to create the surround with MiniDSP.

IE, to make the left surround channel, we need .87% of the left channel and .49% of the right channel combined, but the left portion is inverted. Since MiniDSP can't invert an input, you would have to make an RCA cable that inverts it. (Just cut the cable in half, swap the positive and negative, and put it back together.) Obviously you'll want to mark this cable because it could really make troubleshooting confusing :)
 
Another nice thing about MiniDSP is that we can still use all of it's features along with the matrix. For instance, in my home the main speakers are close to three meters away from the couch, but the surrounds are a fraction of a meter away. With MiniDSP you can implement attenuation and delay to 'fix' the speaker locations. This makes all the difference in the world; IMHO the main reason that a lot of surround sound setups sound awful is because you MUST compensate for loudspeaker location and amplitude. Even if you're perfectly equidistant from all five speakers, you'll likely find that the room itself is changing the frequency response, which can 'drag' the image towards the louder speakers.
 
https://sourceforge.net/p/equalizerapo/wiki/Configuration reference/

If you're running a home PC, APO can do nearly everything that MiniDSP can do.

This is the main reason that I wrote this post; I wanted to ditch my MiniDSP. I love the thing, but it sure is a mess of cables that doesn't look too good in my living room.

So you can implement all the filters using APO, and if you're using a HTPC you can have a setup that looks really clean.

In particular, we need the copy function:

opy (since version 0.9)
Syntax:
Copy: <Target channel>=<Factor>*<Source channel>+...
Copy: <Target channel>=<Source channel>+...
Copy: <Target channel>=<Constant value>+...
Description:
Replaces the audio on the target channel by the sum of the given source channels with optional factors. To add instead of replace the audio on the target channel, the target channel itself can also be a source channel. The factor can also be specified in dB by appending dB. Multiple channel assignments can be specified on a single line by separating them with spaces, therefore a single assignment must not contain spaces. Instead of channel and factor, a constant value can be specified. To avoid ambiguity with numerical channel indices, the constant value must contain a decimal point. For more information about channel identifiers, see the Channel command.
Example:
# Adds the audio on channel R multiplied by 0.5 to channel L
Copy: L=L+0.5*R
# Replaces the audio on channel L by the audio on channel R
# plus the audio on channel C attenuated by 6 dB
Copy: L=R+-6dB*C
# Replaces the audio on the first channel by the audio previously on channel R
# Also sets the audio on channel R to the constant value 0.5
Copy: 1=R R=0.5
# Attention: Sets the audio on channel L to the audio on the second channel
# (not to constant value 2, because no decimal point is present)
Copy: L=2
# Real world example: Replaces the audio on the subwoofer channel with
# the audio on the left channel while muting all other channels of a 5.1 speaker system
# (useful for measuring the subwoofer response in REW)
Copy: SUB=L L=0.0 R=0.0 C=0.0 RL=0.0 RR=0.0
 
Member
Joined 2014
Paid Member
It's worth an experiment. I have 3 JBL control-1s waiting to be centre and surround just no surround decoder. But in my case the driver is that I want to boost dialog (centre) as for late night films when kids in bed the effects are too loud if you turn it up so you can hear the speech. I've got channels to burn on my 2x10 so why not...
 
It's worth an experiment. I have 3 JBL control-1s waiting to be centre and surround just no surround decoder. But in my case the driver is that I want to boost dialog (centre) as for late night films when kids in bed the effects are too loud if you turn it up so you can hear the speech. I've got channels to burn on my 2x10 so why not...

At low frequency our perception of location is based on phase. Due to that, the presence of a center channel can narrow the stage. IE, if you have two speakers, the stage is defined by those two speakers. Add in a third and the location gets 'pulled' toward the center because the center features sounds that exist in both the left and in the right.

The simplest way to fix this is with a simple high pass; you just let the left and the right speakers cover the low frequencies, and high pass the center.

ina1_29.jpg

If you think about it, this is also one of the reasons that Opsodis works so nicely. Removing the low frequencies from the speaker in the center allows you to make a larger soundstage.
 
Nice info, Bill, but I don't see an important component here in the thread, which is the channel steering.

Just quickly, I worked for one of Dolby's competitors and was able to look at the reverse engineered schematics, as well as evaluated our own version. So I know at least the pro end as well as anyone left around. :) If you know what a CP-50 was, you'll know what I'm talking about. What follows here specifically excludes mag-tape movies, and Dolby Digital or DTS.

You got the encoding right (as far as I can tell) but since Dolby Stereo tried to encode 4 (L,C,R,S) or 5 channels (split surround) into two analog tracks that were actually on the film, the decoding was never this straight forward. When VHS came out of course it was first stereo then Hi-Fi stereo, and they took the tracks as-is from the film versions.

While we can mathematically make sense of adding L and R to get a center, removing the center from the L and R signals is quite tricky in an analog realm.

Dolby Stereo (as the pro version was called) steered channels aggressively. The first home version was called Dolby Surround and if memory serves, did not steer at all. The first home version to incorporate the channel steering was called Dolby Pro-Logic, and AFAIK, was basically Dolby Stereo for home, and on a chip.

What I mean by "channel steering" is that there were a number of VCAs (Voltage Controlled Amplifiers) which would, depending on a number of factors, raise and lower the gain of each channel. The logic seemed to want to choose between immersion, where all channels are active, and effects, when events would take place predominantly L, C, or R for instance. So, an explosion on the right would cause the L,C and S channels to drop.

As I recall (and we're talking decades back) there was also a number of phase inversion happening to try to isolate the center from L and R. A decoding matrix involved around 8 VCA channels and 16 op amps which were used for mixing various combinations of signals together, and altering the mix dynamically. So VCA's were used to control not just the output of each channel, but also the mixing used to try to isolate each channel.

Dolby Prologic II of course was an enhancement which added L/R surround steering (my company actually did this first!) and later on, consumer gear also got a music mode too. It is my belief (without data) that DPL II also had a nicer overall steering mechanism, which was not as aggressive. ( BTW, if you have Neo6, the music mode is really great with a center channel! ).

The idea in theaters was to give as many people as good of an experience as possible. If you were up front, channel steering was essential. I imagine it was quite maddening for recording engineers, as doing a delicate pan from L to R was probably a giant PITA, as you could not avoid the steering mechanism.

We are very fortunate to be in an era of mostly discrete channels now.


Best,


E
 
Last edited:
  • Like
Reactions: 1 user
To give you guys an idea of the actual analog circuits, using op amps and VCA's (16 pin DIP) I was able to squeeze our version into a 4" x 5" PCB using resistors stood on end. It was about 80% full of parts. The Dolby version used about 3x the PCB.

To his credit, our chief engineer never attempted to copy the Dolby version, but looked at the operating principles applied. Our version was, IMHO much better sounding, and probably closer to what DPL II would do.

What I know for sure is that the pro decoders used Dolby-A noise reduction on the L and R source channels, which was done before feeding the 2-> 4 channel decoder. All the cards in the CP-50 conformed ot the same size as the larger Dolby-A NR cards.

I'm shaking off my foggy memory here, but if I recall correctly, we found something very peculiar when looking at the PCB from the CP-50. Inside the matrix card there was this little Dolby B chip normally found in boom boxes specifically for the surround channels. It was very very odd for us to find that chip in the decoding matrix.

We did not use it and could not tell the difference. :)

Since Dolby Surround got popular with VHS Hi-Fi I would like to believe that any noise reduction was not used for VHS since VHS Hi-FI had a phenomenal S/N ratio and dynamic range, unlike film, and really had no need for it.

Best,

E

Best,

E
 
Last edited:
  • Like
Reactions: 1 user
Member
Joined 2014
Paid Member
Erik: Fully understand the compromises involved, but given that blu-ray players don't have individual channel outputs until you hit $$$ levels you are stuck with what comes out the spdif as the proper signal goes out the HDMI. I will be getting a receiver, but that won't seamlessly integrate with my setup. For step one (getting audible dialog without end stopping a woofer when the golden gate bridge gets blown up yet again) its worth a try.
 
Hi Bill,

DD and DTS are much better, but you have to make the full commitment. :)

That is, have a subwoofer, calibration, room acoustics, EQ for the sub.

I will say properly set up even a small system can be thrilling and make you wonder why you go to a movie theater. :)

The biggest transition from DPL to DD was the lack of steering, which makes movies seem much more natural, and less "Bam, WHam!"

Best,

E
 
Last edited:
Member
Joined 2014
Paid Member
It doesn't have Neo6. I have to admit not being impressed by the sound at our local vue. You want to puke from the bass levels in the trailers, then there is the deafening THX ad (as parodied in the simpsons here https://www.youtube.com/watch?v=K3_HHZFi0As and WB here https://www.youtube.com/watch?v=wlnI6XjWk_k) But once the movie starts the sound goes flat and I wonder if the surround channels are even on.

Back to the 11'x12' living room in my hovel and I don't even have symmetric locations for rears other than pointing straight down so good surround is unlikely
 
As Erik noted on page one, and as Andy Wehmeyer noted here(1), the solution that I propose on page one is fairly useless without steering.

There seems to be a zillion ways to do this, and all of them have various issues:

1) There are processors you can buy on Amazon or eBay. It's really difficult to ascertain if they're legitimately doing Dolby Prologic II. (IE, are they using legitimate licensed silicon, or did they just slap a fake DPL II logo on their box, with their own processing?)

2) You can get legitimate Dolby PL II processing in various HT receivers. But a lot of us are doing our own DSP and processing, so we don't WANT to use a home theater receiver. That's the situation I'm in. I want to use MiniDSP and a HTPC source. That means a HT receiver does me no good.

3) PowerDVD and various other software players can do the decoding. But then you have to spend $80 and you're tied to their software. This is a p.i.t.a. if you're doing a HTPC or you want to do Dolby PL II in a car. (I don't want to deal with the PowerDVD interface on my Windows tablet, the screen is too small.)


Here's a method which I think is (fairly) elegant:

Step 1: download foobar 2000 (foobar2000)
Step 2: download the "freesurround" plugin (foo_dsp_fsurround)
Step 3: download ffmpeg (Builds - Zeranoe FFmpeg)
Step 4: load your song or songs into Foobar 2000, and configure the input and output plugins accordingly. I am using "wav" for the output format, and I am using the "FreeSurround" DSP processing.
Step 5: Once you have Foobar2000 convert your track or tracks, you will have a six channel wav file for each song.
Step 6: If you have a HTPC, you might just play those WAVs. I have a tablet with limited space, so I convert the six channel WAV to a six channel AAC file. AAC supports something like a hundred channels, so you can go crazy with the surround options. Here's the command line:

ffmpeg -i [wav file] -c:a aac -b:a [bit rate] [aac file]

for instance:

ffmpeg -i Mercy.wav -c:a aac -b:a 384k mercy.aac

My six channel WAV was 176MB, and encoding in AAC at 384K reduced the size to 16MB.

I used "Mercy" by Kanye West for my testing. A great deal of the song is out-of-phase, and the vocals float all over the stage. So it's a bit of a torture test for an upmixer.

wz7ApNL.png

Here's what the stereo track looks like in Audacity. Your basic pop track with maximum loudness.

JYY0eYW.png

Here's the track after processing by FreeSurround. You six distinct channels. Most impressively, I listened to the isolated surround channels and the steering did a (fairly) excellent job of keeping vocals out of the surrounds. Andy or Erik would have to chime in on how the steering works, but listening to the surrounds by themselves reminded me a bit of a noise gate. The steering seems to 'detect' when there's something in the surrounds that belongs in the mains, and it seems to attenuate that dynamically. If you look at the content in the surround, and you see those big spikes, that was when vocals wound up back there, and the steering quickly attenuated it. (As noted earlier in this thread, the song "Mercy" is largely out of phase, so an upmixer WITHOUT steering would send the vocals to the back channels. This is because an unsteered upmixer does a phase reversal. So the out-of-phase lyrics on the original song would be inverted into mono and send to the surrounds. Again, a bit of a 'torture test' for an upmixer.

Upmixing really seems to be an art, so if any of you have messed around with Penteo surround or the like, chime in with your opinions.

(1) Car Audio | DiyMobileAudio.com | Car Stereo Forum - View Single Post - Five Channel Soundstage
 
Last edited:
Y2qNzzi.png


I did another test. In this test, I created a stereo file with pink noise. The pink noise is slooowly faded from one channel to the other. You can see this on the clip on the left. See how the sound starts on one side of the stage then fades to the other?[/b]

Then I converted it to five channel with FreeSurround. It seems to be doing it's job. In the FreeSurround clip, you can see the following:

1) The sound starts on the left
2) Then it moves to the center channel
3) Then it moves to the right
4) There's nothing sent to the surround
5) There's some LFE

Seems to be doing it's job.