Codebook generator using the ELBG algorithm