Automatic Detection of A Phases of the Cyclic Alternating Pattern