channel calculator implemented in py