this is an old thread, but as multi-channels are starting to be less uncommon, this subject becomes more important..
QUOTE(2Bdecided @ Mar 29 2004, 05:50 PM)
Strangely, I think the correct answer might be...
loudness = SQRT(( MS(channel[1]) + MS(channel[2]) + ... + MS(channel[n]) ) / 2)
I thought about it and I agree.
(the "... / 2" part made it falsely seem like an average of stereo tracks, but indeed it's a sum and the algorithm would just be easier to grasp without the division by 2. its effects cancel out anyway, since the same division is applied to the reference signal..)
[ The 1 channel case is treated specifically by the algorithm, because all hi-fi setups treat mono as 2x same channel, rather than truly one channel, and the algorithm reflects that. ]
Is the replaygain code (in foobar and other implementations) already using this formula ?
BTW, that means that if you take a (false-stereo) track, and replicate it into 6 different channels, the replaygain will now be 20*Log(n/2) dB = 9.5 dB *lower*.
Can someone with a multi-channel set-up test this kind of thing and check that it does lead to the same loudness as the original 2 channel track ?
Maybe multi-channel amplifiers & speakers don't work with the same scale when in stereo-mode vs 5.1 mode (e.g., you could imagine 5.1 amplifiers have this 9.5dB attenuation *built in* in 5.1 mode, precisely for the same reason : so that people could switch between 5.1 and stereo without the loudness jumping up and down by 10dB..)
If the power-scaling induced by the number of channel is already cancelled by amplifiers, then the 5.1 replaygain shouldnt work on the powers sum, but indeed on the average power and the formula should precisely be :
loudness = SQRT(( MS(channel[1]) + MS(channel[2]) + ... + MS(channel[n]) ) /
n)
Maybe the built-in channel-scaling attenuation isn't exactly 20*Log(n/2) dB either, but, e.g. a bit less to maybe account for the fact the bass channel typically holds less power (or more, or whatever)..
in the end the best choice might be to have replaygain store the *channels-averaged* replaygain, and let the player handle attenuation due to number of channels. It can then, for instance, provide user-customizable additional attenuation settings for all possible number of channels, using 20*log(n/2) dB as a default..
That's probably best in any case, it's more intuitive to have Replaygain values be independant of the number of channels. I know how loud a RG=-11dB stereo track is. But for a 5.1 track, if the powers are summed up, -11dB is equivalent to -1.5 dB stereo, and so -11dB for 5.1 is quiet audio..