Matlab code to simulate a JPEG compression. Adopted from "JPEG Tutorial, by Andrew B. Lewis, University of Cambridge, computer laboratory"