Scale factor explaination 
Scale factor explaination 
Jul 8 2011, 18:15
Post
#1


Group: Members Posts: 57 Joined: 19January 11 Member No.: 87451 
Hi,
Can anybody explain me the concept of scale factors in AAC? I mean how the scale factors are determined for spectral values? Also in the distortion control loop how incrementing the scale factors and then scaling with it reduces distortion? Please explain.. 


Jul 8 2011, 19:51
Post
#2


Winamp Developer Group: Developer Posts: 669 Joined: 17July 05 From: Ashburn, VA Member No.: 23375 
scale factors are basically the MDCT coefficients, with some math involved to quantize the values to reduce entropy. The amount of quantization necessary for each band/scalefactor (and therefore the amount of precision it will have) is determined as part of your psychoacoustic algorithm.



Jul 9 2011, 12:13
Post
#3


Group: Members Posts: 116 Joined: 3April 09 Member No.: 68627 
I think benski's answer is not very clear. I'll try to explain a little further.
The scale factors are just what they're called  the scale factors. The resolution is controlled by scaling. Assume we have a set of real numbers from the range of [0, 1]. If we quantize them to, say, 10bit integer with a uniform quantizer we'll obtain a corresponding set of integer numbers in range [0, 1023]. If, however, we scale the initial set by factor of 0.5 prior to quantization, the resulting integers will fit into [0, 511], occupying not more than 9 bits. Every multiplication by 0.5 effectively shaves off a single bit from the result, at the cost of increased error in reconstruction of the original set. Now what exactly is called a "scale factor" may differ from implementation to implementation. In the above example we could say that the scale factor is 0.5, or we could say that it's 511, or we could call the exponent log2(0.5) = 1 a scale factor, or we could define the scale factor as reciprocal value (1/0.5) etc. Also in actual audio compression algorithms the quantization is nonuniform, and the scale factors are not necessarily restricted to integer powers of two. But the principle is still the same. As for the particular scale factor values, as benski said, they are assigned by the encoder according to psychoacoustic model that determines the allowed amount of error in each spectrum band depending on the computed masking thresholds. 


Jul 12 2011, 07:52
Post
#4


Group: Members Posts: 57 Joined: 19January 11 Member No.: 87451 
Thanks to both of you for this useful information..



Jul 12 2011, 08:01
Post
#5


Group: Members Posts: 57 Joined: 19January 11 Member No.: 87451 
Hi,
But can you explain me how every multiplication with 0.5 increases error? because to the decoder we are passing that scale factor as side info and it multiplies it with the inverse quantized spectral coefficients..So where does the error come from?Please explain... Thank you 


Jul 12 2011, 09:21
Post
#6


Group: Developer Posts: 682 Joined: 6December 08 From: Erlangen Germany Member No.: 64012 
The increased error happens in the quantization (i.e. rounding) of the prescaled MDCT coefficients. Example:
Encoder Input MDCT coefficients: [3, 1, 4, 1, 5, 9, 2, 6, 5] Divide by scale factor sf1 = 2: [1.5, 0.5, 2, 0.5, 2.5, 4.5, 1, 3, 2.5] (AAC: apply a power law on the MDCT coefficients here) Quantize coefficients by e.g. truncating to integer: [1, 0, 2, 0, 2, 4, 1, 3, 2] Decoder (AAC: apply inverse power law on the quantized coefficients here) Multiply by scale factor sf1 = 2: [2, 0, 4, 0, 4, 8, 2, 6, 4] What you get is the dequantized (or inverse quantized) MDCT spectrum. Notice that it has only 5 different values, whereas the original MDCT had 7 different values. If you would use a scale factor sf2 = 4 = sf1 / 0.5, the quantization would lead to only 3 different values => sf2 leads to more distortion (error) than sf1. Chris This post has been edited by C.R.Helmrich: Jul 12 2011, 09:27  If I don't reply to your reply, it means I agree with you.



Jul 12 2011, 09:45
Post
#7


Group: Members Posts: 57 Joined: 19January 11 Member No.: 87451 
Thanks chris, it was really a good explaination...



LoFi Version  Time is now: 21st April 2014  03:41 