/

I almost deleted this feature

How a stereo-width function became a lesson in correlation, quadrature and mastering-grade restraint.

Panoramic stereo image processor with a stereo meter leaning left

Panoramic is a mastering-grade stereo image processor. So every DSP decision had to be placed around the mantra of “do-no-harm”. Especially because mixes that come into master MUST BE RESPECTED.

When it comes to the stereo image, the slightest offence can make the master crumble and leave clients angry.One common theme though is a client coming in with a mix and a reference. The mix is narrow, the reference is WIDE.The mix only has limited side-signal information, maybe some instrument reverb or panned percussion, but THAT IS IT.

So I developed the STEAL function inside Panoramic. Take the mid-signal, generate harmonics, put those harmonics on the side. More width, and the mono stays 1:1 as per the original.

At least that’s what I thought.

In the first version, the harder I pushed the feature, the further the stereo image leaned left. Push polarity, and it was off to the right. Remember how I said, the mantra of “Do-No-Harm”… well this didn’t meet it!

For a production tool, that might have been dismissed as an edge case at an extreme setting. For a mastering processor, it was unacceptable.


Where the tilt came from

Panoramic utilises mid-side encoding and decoding as core processes.

The Steal function starts from the Mid signal. It creates harmonics that are blended into the Side path.

Those harmonics are;

D(x,d) = x − tanh(dx) / d

Here:

  • (x) is the Mid input.
  • (d) controls the amount of drive.

The tanh stage saturates the signal. Subtracting that processed version from the mix input produces the delta we can use for blending. The problem is that those odd-order harmonics are mathematically correlated to the original mid-signal, and therefore will impact their reconstruction in a mid-side matrix.

T = Generated harmonics in the side signal.

L′ = M + T
R′ = M − T

That is a normal mid-side matrix, but the problem of the tilting stereo image happens because the generated harmonics retain correlating information with the mid-signal. That is why the early version leaned left.

Signal flow from Mid signal through tanh saturation and nonlinear delta into the Side path
Steal begins with information from the Mid signal, creates a nonlinear delta, and introduces that information into the Side path.

Why a normal delay could not solve it

So how do we change the relationship between the mid-signal and the new harmonics?

At zero degrees, their relationship is positive.
At 180 degrees, it is negative.
At 90 degrees, the relationship falls to zero.

That sounds simple enough.But a mix is not one sine wave. They have thousands of different frequency components oscillating at different rates.

Frequency Cycle length Quarter cycle
100hz 10 milliseconds 2.5ms
1khz 1 millisecond 0.25ms
10khz 0.1 milliseconds 25 microseconds

The required quarter-cycle delay is:

τ90°(f) = 1 / 4f

To create a true 90-degree decorrelation, each frequency component needs to be shifted relative to their own oscillation speed. That’s the principle behind a Hilbert Transform/ Hilbert function.


Approximating quadrature inside Panoramic

A Hilbert transform creates a quadrature companion to a signal while preserving its frequency balance. In real-time DSP, that behaviour is approximated. Panoramic uses a two-branch IIR all-pass network. Each branch has 8 cascaded 2nd-order all-pass filters.

Each filter follows this transfer function

Ha(z) = (z−2 − a) / (1 − az−2)

All-pass filters pass frequencies without boosting or cutting their magnitude; their purpose is to manipulate phase. The designed networks are full-band, and they don’t use any crossover bands either. Instead, the cascaded filters produce smooth frequency-dependent phase behaviour that approximates a quadrature pair across the frequency range, shifting each frequency component by a quarter cycle. By approximating a quadrature signal, the generated harmonics’ phase/mathematical relationship with the original mid-signal is decorrelated to prevent any tilting in the stereo image.


The real lesson

Making something wide is not difficult in audio. But making something wide without destroying the balance a producer or mixer establishes is.

That’s the difference between a concept or theory, and real-life practising tools that work on peoples session. Panoramic exists because it’s the tool I personally use on masters for my clients.