AN2094 Freescale Semiconductor / Motorola, AN2094 Datasheet - Page 39

no-image

AN2094

Manufacturer Part Number
AN2094
Description
ITU-T G.729 Implementation on StarCore SC140
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Freescale Semiconductor
}
}
/* Compute energy with split-summation.
s0 = 0;
s1 = 0;
p = &signal[p_max];
for (i=0; i < L_frame; i+=2)
{
}
s0 = L_add(s0, s1);
/* compute 1/sqrt(energy), with the result in Q30 */
s0 = Inv_sqrt(s0);
/* compute max = max/sqrt(energy)
/* This result will always be 16 bit-aligned. */
s0 = Mpy_32_new(max, s0);
*cor_max = extract_l(s0);
return (lag_max - p_max);
* Split-summation is performed with 2 partial sums because the array
* is not aligned.
*/
}
/* The function must favor the correlation with the maximum lag */
/* Test if the correlation computed is greater than previous maximum */
if (c3 > max)
{
}
if (c2 > max)
{
}
if (c1 > max)
{
}
if (c0 > max)
{
}
s0 = L_mac(s0, p[i+0], p[i+0]);
s1 = L_mac(s1, p[i+1], p[i+1]);
c2 = L_mac(c2, rs, sig3);
c3 = L_mac(c3, rs, sig0);
rs = ref_signal[j+2];
sig1 = signal[i+j+5];
c0 = L_mac(c0, rs, sig2);
c1 = L_mac(c1, rs, sig3);
c2 = L_mac(c2, rs, sig0);
c3 = L_mac(c3, rs, sig1);
rs = ref_signal[j+3];
sig2 = signal[i+j+6];
c0 = L_mac(c0, rs, sig3);
c1 = L_mac(c1, rs, sig0);
c2 = L_mac(c2, rs, sig1);
c3 = L_mac(c3, rs, sig2);
rs = ref_signal[j+4];
sig3 = signal[i+j+7];
max
p_max = i+3;
max
p_max = i+2;
max
p_max = i+1;
max
p_max = i;
= c3;
= c2;
= c1;
= c0;
ITU-T G.729 Implementation on the StarCore™ SC140/SC1400 Cores, Rev. 1
*/
References
39

Related parts for AN2094