Phase retrieval in generalized optical interferometry systems