Advertisement
Guest User

Untitled

a guest
May 24th, 2015
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. def SNR(original, quantificado):
  2.  
  3. original = np.asarray(original).reshape(-1).astype('float')
  4. quantificado = np.asarray(quantificado).reshape(-1).astype('float')
  5.  
  6. erro = quantificado - original
  7. SNR = 10.*np.log10(sum(original**2)/sum(erro**2))
  8.  
  9. return SNR
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement