Log energy calculation I have some code here that I don't quite understand.
It calculates the energy for a given frame the following way:

En=log(1+energy(32767*frame))


The energy function is defined as

energy = sum(s.*s)/max(size(s))


Where 's' is te given frame. 

What I don't understand is why the frame needs to be multiplied by 32767, which is the max value for unsigned int 16. I couldn't find the theory behind this. Does anyone of you know why this multiplication is taking place? Does it have to do anything with the log calculation?max value for unsigned int 16. I couldn't find the theory behind this. Does anyone of you know why this multiplication is taking place? Does it have to do anything with the log calculation?
First of all, the amplitude of a signal is expressed in arbitrary units, so there is no "right" answer. It's unlikely you'll be able to compute an absolute acoustic energy value - this depends on the gains of the recording chain, and the characteristics of the transducers.

Some audio analysis/feature extraction software consider that the full scale of the input audio signal is [-32768, 32767] (due to the predominance of the 16-bit format), some other implementation expect their input to be in the [-1.0, 1.0] range. Matlab's wavread function can return both formats when reading data, with the 'double' or 'native' argument.

I suspect the multiplication by 32767 in your code is simply there to keep the output consistent with a reference implementation of the algorithm which expected data to be in the [-32768, 32767] range, or maybe to keep the results consistent with a previous version of the software that used an input signal with the 'native' instead of 'double' scale.