What's the proper way to pan a stereo signal?

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

Thanks asseca, I think I now have more than enough options!

I did notice one problem in your original linear pan (just a typo I think):

Code: Select all

if fPan > 0 then begin
  Buf[L] := Buf[L]*(1-fPan); 
{    Buf[R] := Buf[L] + Buf[R]*(fPan);     L & R back to front }
     Buf[R] := Buf[R] + Buf[L]*(fPan);
end 
else if fPan < 0 then begin
  Buf[L] := Buf[L] + Buf[R]*(-fPan); 
  Buf[R] := Buf[R]*(1+fPan);
end;
Thanks again,
Brad

Post

Yes, sorry about that, I have fixed it in the previous posts.
Also, if I recalculate the original stereo linear pan to a mono linear pan, then this is the result:
("fpan" range -1 .. 0 .. +1)

Code: Select all

if fPan > 0 then begin 
  Buf[L] := (1-fPan)*MonoIn;  
  Buf[R] := MonoIn + MonoIn*(fPan); 
end 
else if fPan < 0 then begin 
  Buf[L] := MonoIn + MonoIn*(-fPan);  
  Buf[R] := MonoIn*(1+fPan); 
end;
From the above one can see that again in center position there is no calculation needed. (i.e. center is unity gain)
Panning hard left or right results in a 6dB gain. (which is how an analog mixer works)

Post

No, an analog mixer usually lowers the "away" side -- panning hard either way results in a 3dB overall reduction with uncorrelated stereo signal, or 6dB for mono. At least, TASCAM, Yamaha, and EV mixers I've owned did that.

Post Reply

Return to “DSP and Plugin Development”