On the rear side the function given by the AES paper has the same end points, but is
different in-between.
The mathematical method in the AES paper provides the following equations for the Left
Rear matrix elements over the range 22.5 < lr < 45: (remember that t = 45-lr)
LRL = cos(45-lr)*sin(4*(45-lr))-sin(45-lr)*cos(4*(45-lr)) = sra(lr)
LRR = -(sin(45-lr).*sin(4*(45-lr))+cos(45-lr).*cos(4*(45-lr))) = -srac(lr)
If cs <= 22.5, lr can still vary from 0 to 45. The AES paper defines LRL and LRR when lr
has the range 0 < lr < 22.5 of: - see Figure 6 in the AES paper.
LRL = cos(lr) = sra(lr)
LRR = -sin(lr) = -srac(lr)
The two functions sra(x) and srac(x) – are defined for 0 < lr < 45.
March 1997
In March 1997 the following technique is used to fix the discontinuity across the cs=0
boundary. In the AES paper near cs=0 LRL and LRR are both functions of a single
variable. To fix the lack of continuity along the cs=0 boundary we add a function of a
composite of lr and cs. The new variable is lr_bounded, the bounded difference between
lr and cs. The definition of this variable is sufficiently complicated that I will present it in
MATLAB.
lr_bounded = lr - cs; % find the difference
if (lr_bounded <0) % % only if lr > cs
lr_bounded = 0;
if (45-|cs| < lr_bounded) % use the smaller of the two values
lr_bounded = 45-cs;
We define a new function which is equal to the difference between equation sra(x) and
(1-GSL(x)) when cs=0. This is rear_active_correct(lr_bounded).
For 0 < x< 45
Rear_active_correct(x) = sra(x) – (1 - GSL(x))
LRL = (sri(cs) + sra(lr) - rear_active_correct(lr_bounded) -1 ) * tvcorr(|lr|+|cs|)