prologic II encoding

Posted in Uncategorized by flow on the July 6th, 2009

i’m trying to implement prologic II encoding, so i can use it as a vst plugin in ableton.

what i’d liek to be able to do is create a nicely encoded stereo output that i can either pipe straight to a prologic decoder, or export to file, and make prologic encoded music. one day i aim to own a 5.1 dance rig, so i want to get this right, so fellow producers can use the tech.

well. i’m using reaktor 5, since its got some handy core cell stuff, like fft available.

i spent ages messing around, working out the phase from the real and imaginary components, deriving the magnitude, changing the phase, calculating the new sign, sending it back through the ffts and it was nothing but trouble. the arctan wasn’t precise, neither were the sin or cosines and it made horrible rackets. i tried all sorts of flow control methods to check for zeros but i kept getting dc. ouch.

then i got out a pencil and paper. what does +90 degrees look like? a few triangles later and i spotted the obvious.

in k-space, +90 degrees is equivalent to setting r=-i, and i=r
-90 is r=i and i=-r
that’s done simultaneously, not sequentially.

so, toss the trig out the window and do a few multiplications by 1 or -1 (to keep the calculation path length the same, just in case) and voila! the signal shoots back to the rear channel. as will any signal when you invert its left and right.

there is a formula i got from several sources on the net:

Dolby Pro Logic II matrix encoding (2:5)

Encoding matrix Left Right Center Rear Left Rear Right
Left Total 1 0 sqrt(1/2) j sqrt(2/3) j sqrt(1/3)
Right Total 0 1 sqrt(1/2) k sqrt(1/3) k sqrt(2/3)
j = + 90 degrees phase-shift, k = -90 degrees phase-shift

so i implemented it.

one problem, the rear channel separation isn’t perfect. i get audible signal from both, and i can’t localise in one speaker. now is this a fault with my method, or is this a feature of prologic?

i’m not sure how dolby does its actual phase shift, but looking at the manufacturers of the chips they use, i bet they are using fft. its easy in digital.

No Comments »

No comments yet.

RSS feed for comments on this post. | TrackBack URI

Leave a comment

XHTML ( You can use these tags): <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> .

Powered by WordPress .::. Designed by SiteGround Web Hosting