Source: https://www.creatis.insa-lyon.fr/~grenier/wp-content/uploads/teaching/DSP/TP-C54.pdf