## Scale factor explaination

#####
Reply #5 –

The increased error happens in the quantization (i.e. rounding) of the pre-scaled 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