view util/snr.m @ 194:9b0595a8478d danieleb

Debugged SMALL_DL_test and added copyright info
author Daniele Barchiesi <daniele.barchiesi@eecs.qmul.ac.uk>
date Tue, 13 Mar 2012 17:53:46 +0000
parents 88578ec2f94a
children
line wrap: on
line source
function x = snr(s,r)
% SNR calculates the signal-to-noise ratio between the signal s and its
% representation r defined as:
% SNR = 20*log10(||s||_2/||s-r||_2)
err = s-r;
x = mag2db(norm(s(:))/norm(err(:)));