Acoustic emission to evaluate the energy dissipation during compression of heterogeneous materials