Source: http://www.dcs.gla.ac.uk/~jsinger/pdfs/jp2_notes.pdf