http://paginas.fe.up.pt/~lreal/Tele2/source_coding_matlab.pdf