Mercurial > hg > smallbox
view util/snr.m @ 176:d0645d5fca7d danieleb
added MOCOD dictionary update
author | Daniele Barchiesi <daniele.barchiesi@eecs.qmul.ac.uk> |
---|---|
date | Thu, 17 Nov 2011 11:17:44 +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(:)));