Fix calculation of SNR.

Need to make sure the log of the linear quantities is actually taken,
so to_dB() is corrent, not make_dB(). Also, fix grouping to get proper
unitless conversion.