decode with your own matrix